Exemplo n.º 1
0
        public static bool Update(BaseParkinfo model, bool addlog = true)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (string.IsNullOrWhiteSpace(model.PKNo))
            {
                throw new MyException("车场编号不能为空");
            }

            IParking     factory = ParkingFactory.GetFactory();
            BaseParkinfo park    = factory.QueryParkingByParkingNo(model.PKNo);

            if (park != null && park.PKID != model.PKID)
            {
                throw new MyException("车场编号不能重复");
            }

            bool result = factory.Update(model);

            if (result && addlog)
            {
                OperateLogServices.AddOperateLog <BaseParkinfo>(model, OperateType.Update);
            }
            return(result);
        }
Exemplo n.º 2
0
 public void Statistics_DailyGather(string PKID, DateTime start, DateTime end)
 {
     try
     {
         IParking        iparking = ParkingFactory.GetFactory();
         string          strerror = string.Empty;
         var             parking  = iparking.QueryParkingByParkingID(PKID);
         List <ParkGate> gatelist = ParkGateServices.QueryByParkingId(PKID);
         try
         {
             var p = iparking.QueryParkingByParkingID(PKID);
             new DailyGatherServices().Statistics_DailyByHour(p, start, end);
         }
         catch (Exception ex)
         {
             Common.Services.TxtLogServices.WriteTxtLog("按时统计异常 异常信息:{0}", ex.Message);
         }
         //按通道统计时数据
         try
         {
             new GateGatherServices().Statistics_DailyByGate(gatelist, parking, start, end);
         }
         catch (Exception ex)
         {
             Common.Services.TxtLogServices.WriteTxtLog("按通道统计异常 异常信息:{0}", ex.Message);
         }
     }
     catch (Exception ex)
     {
         Common.Services.TxtLogServices.WriteTxtLog("按日统计异常 异常信息:{0}", ex.Message);
     }
 }
Exemplo n.º 3
0
        public static bool Add(BaseParkinfo model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (string.IsNullOrWhiteSpace(model.PKNo))
            {
                throw new MyException("车场编号不能为空");
            }

            IParking     factory = ParkingFactory.GetFactory();
            BaseParkinfo park    = factory.QueryParkingByParkingNo(model.PKNo);

            if (park != null)
            {
                throw new MyException("车场编号不能重复");
            }

            model.PKID = GuidGenerator.GetGuidString();

            using (DbOperator dbOperator = ConnectionManager.CreateConnection())
            {
                try
                {
                    dbOperator.BeginTransaction();
                    bool result = factory.Add(model, dbOperator);
                    if (!result)
                    {
                        throw new MyException("添加车场信息失败");
                    }

                    result = ParkCarModelServices.AddDefault(model.PKID, dbOperator);
                    if (!result)
                    {
                        throw new MyException("添加车型失败");
                    }

                    result = ParkCarTypeServices.AddDefault(model.PKID, dbOperator);
                    if (!result)
                    {
                        throw new MyException("添加车类型失败");
                    }
                    dbOperator.CommitTransaction();
                    if (result)
                    {
                        OperateLogServices.AddOperateLog <BaseParkinfo>(model, OperateType.Add);
                    }
                    return(true);
                }
                catch
                {
                    dbOperator.RollbackTransaction();
                    throw;
                }
            }
        }
Exemplo n.º 4
0
        public static List <BaseParkinfo> QueryParkingByCompanyIds(List <string> companyIds)
        {
            if (companyIds == null || companyIds.Count == 0)
            {
                throw new ArgumentNullException("companyIds");
            }
            IParking factory = ParkingFactory.GetFactory();

            return(factory.QueryParkingByCompanyIds(companyIds));
        }
Exemplo n.º 5
0
        public static List <BaseParkinfo> QueryParkingByVillageId(string villageId)
        {
            if (string.IsNullOrWhiteSpace(villageId))
            {
                throw new ArgumentNullException("villageId");
            }
            IParking factory = ParkingFactory.GetFactory();

            return(factory.QueryParkingByVillageId(villageId));
        }
Exemplo n.º 6
0
        public static List <BaseParkinfo> QueryParkingByRecordIds(List <string> recordIds)
        {
            if (recordIds == null || recordIds.Count == 0)
            {
                throw new ArgumentNullException("recordIds");
            }
            IParking factory = ParkingFactory.GetFactory();

            return(factory.QueryParkingByRecordIds(recordIds));
        }
Exemplo n.º 7
0
        public static BaseParkinfo QueryParkingByRecordId(string recordId)
        {
            if (string.IsNullOrWhiteSpace(recordId))
            {
                throw new ArgumentNullException("recordId");
            }
            IParking factory = ParkingFactory.GetFactory();

            return(factory.QueryParkingByRecordId(recordId));
        }
Exemplo n.º 8
0
        public static List <BaseParkinfo> QueryParkingByVillageIds(List <string> villageIds)
        {
            if (villageIds == null || villageIds.Count == 0)
            {
                throw new ArgumentNullException("villageIds");
            }
            IParking factory = ParkingFactory.GetFactory();

            return(factory.QueryParkingByVillageIds(villageIds));
        }
Exemplo n.º 9
0
        public static BaseParkinfo QueryParkingByParkingID(string ParkingID)
        {
            if (string.IsNullOrEmpty(ParkingID))
            {
                throw new ArgumentNullException("villageIds");
            }
            IParking factory = ParkingFactory.GetFactory();

            return(factory.QueryParkingByParkingID(ParkingID));
        }
Exemplo n.º 10
0
        public static int UpdateCarBit(string PKID)
        {
            IParking factory = ParkingFactory.GetFactory();
            int      result  = factory.UpdateCarBit(PKID);

            if (result > 0)
            {
                OperateLogServices.AddOperateLog(OperateType.Update, string.Format("PKID:{0}", PKID));
            }
            return(result);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 修改车场结算配置
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool UpdateParkSettleConfig(BaseParkinfo model)
        {
            IParking factory = ParkingFactory.GetFactory();
            bool     result  = factory.UpdateParkSettleConfig(model);

            if (result)
            {
                OperateLogServices.AddOperateLog <BaseParkinfo>(model, OperateType.Update);
            }
            return(result);
        }
Exemplo n.º 12
0
        public static List <BaseParkinfo> QueryPage(string villageId, int pageIndex, int pageSize, out int totalCount)
        {
            IParking            factory     = ParkingFactory.GetFactory();
            List <BaseParkinfo> parkings    = factory.QueryPage(villageId, pageIndex, pageSize, out totalCount);
            IParkArea           factoryArea = ParkAreaFactory.GetFactory();

            foreach (var item in parkings)
            {
                item.CarBitNum = factoryArea.GetCarBitNumByParkingId(item.PKID);
            }
            return(parkings);
        }
Exemplo n.º 13
0
 public void Statistics_DailyGather(DateTime start, DateTime end)
 {
     try
     {
         IParking            iparking = ParkingFactory.GetFactory();
         string              strerror = string.Empty;
         List <BaseParkinfo> parks    = iparking.QueryParkingAll();
         if (parks == null || parks.Count == 0)
         {
             return;
         }
         end = end.Date.AddHours(23).AddMinutes(59);
         //循环车场
         foreach (BaseParkinfo p in parks)
         {
             //如果在线上统计,则本地就不统计
             if (p.IsOnLineGathe == YesOrNo.Yes)
             {
                 continue;
             }
             List <ParkGate> gatelist = ParkGateServices.QueryByParkingId(p.PKID);
             TimeSpan        ts       = end - start;
             //统计近8天的数据
             for (int i = ts.Days; i >= 0; i--)
             {
                 try
                 {
                     new DailyGatherServices().Statistics_DailyByHour(p, end, i);
                 }
                 catch (Exception ex)
                 {
                     Common.Services.TxtLogServices.WriteTxtLog("按时统计异常 异常信息:{0}", ex.Message);
                 }
                 //按通道统计时数据
                 try
                 {
                     new GateGatherServices().Statistics_DailyByGate(gatelist, p, end, i);
                 }
                 catch (Exception ex)
                 {
                     Common.Services.TxtLogServices.WriteTxtLog("按通道统计异常 异常信息:{0}", ex.Message);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Common.Services.TxtLogServices.WriteTxtLog("按日统计异常 异常信息:{0}", ex.Message);
     }
 }
Exemplo n.º 14
0
        public static bool Delete(string recordId)
        {
            if (string.IsNullOrWhiteSpace(recordId))
            {
                throw new ArgumentNullException("recordId");
            }
            List <ParkArea> areas = ParkAreaServices.GetParkAreaByParkingId(recordId);

            if (areas.Count != 0)
            {
                throw new MyException("请先删除改车场下的所有区域");
            }

            IParking factory = ParkingFactory.GetFactory();
            bool     result  = factory.Delete(recordId);

            if (result)
            {
                OperateLogServices.AddOperateLog(OperateType.Delete, string.Format("recordId:{0}", recordId));
            }
            return(result);
        }
Exemplo n.º 15
0
        /// <summary>
        /// 创建默认车场
        /// </summary>
        /// <param name="model"></param>
        /// <param name="dbOperator"></param>
        /// <returns></returns>
        public static bool AddParkinfoDefault(BaseParkinfo model, DbOperator dbOperator)
        {
            IParking factory = ParkingFactory.GetFactory();

            try
            {
                dbOperator.BeginTransaction();
                bool result = factory.Add(model, dbOperator);
                if (!result)
                {
                    throw new MyException("添加车场信息失败");
                }

                result = ParkCarModelServices.AddDefault(model.PKID, dbOperator);
                if (!result)
                {
                    throw new MyException("添加车型失败");
                }

                result = ParkCarTypeServices.AddDefault(model.PKID, dbOperator);
                if (!result)
                {
                    throw new MyException("添加车类型失败");
                }
                dbOperator.CommitTransaction();
                if (result)
                {
                    OperateLogServices.AddOperateLog <BaseParkinfo>(model, OperateType.Add);
                }
                return(true);
            }
            catch
            {
                dbOperator.RollbackTransaction();
                throw;
            }
        }
Exemplo n.º 16
0
        public static List <BaseParkinfo> QueryAllParking()
        {
            IParking factory = ParkingFactory.GetFactory();

            return(factory.QueryAllParking());
        }
Exemplo n.º 17
0
        /// <summary>
        /// 获取支持退款的所有车场
        /// </summary>
        /// <returns></returns>
        public static List <BaseParkinfo> GetParkingBySupportAutoRefund()
        {
            IParking factory = ParkingFactory.GetFactory();

            return(factory.GetParkingBySupportAutoRefund());
        }
Exemplo n.º 18
0
        public static DateTime GetServerTime(out string error)
        {
            IParking factory = ParkingFactory.GetFactory();

            return(factory.GetServerTime(out error));
        }
Exemplo n.º 19
0
        /// <summary>
        /// 当班统计
        /// </summary>
        public void Statistics_OnDuty(string ParkingID)
        {
            try
            {
                IParking                iparking               = ParkingFactory.GetFactory();
                IParkIORecord           iorecordfactory        = ParkIORecordFactory.GetFactory();
                IStatistics_Gather      gatherfactory          = Statistics_GatherFactory.GetFactory();
                IParkChangeshiftrecord  ichangeshift           = ParkChangeshiftrecordFactory.GetFactory();
                IParkOrder              iorder                 = ParkOrderFactory.GetFactory();
                IParkBox                iparkbox               = ParkBoxFactory.GetFactory();
                IStatistics_ChangeShift istatisticschangeshift = Statistics_ChangeShiftFactory.GetFactory();
                BaseParkinfo            parking                = iparking.QueryParkingByParkingID(ParkingID);
                List <ParkBox>          boxlist                = iparkbox.QueryByParkingID(parking.PKID);
                if (boxlist != null && boxlist.Count > 0)
                {
                    foreach (ParkBox box in boxlist)
                    {
                        List <ParkChangeshiftrecord> ondutys = ichangeshift.GetChangeShiftRecord(box.BoxID);
                        if (ondutys == null || ondutys.Count == 0)
                        {
                            continue;
                        }
                        foreach (ParkChangeshiftrecord onduty in ondutys)
                        {
                            Statistics_ChangeShift changeshift = new Statistics_ChangeShift
                            {
                                BoxID         = onduty.BoxID,
                                ParkingName   = parking.PKName,
                                StartWorkTime = onduty.StartWorkTime,
                                EndWorkTime   = onduty.EndWorkTime,
                                ParkingID     = parking.PKID,
                                AdminID       = onduty.UserID,
                                ChangeShiftID = onduty.RecordID
                            };
                            DateTime starttime = onduty.StartWorkTime;
                            DateTime endtime   = DateTime.Now;
                            if (onduty.EndWorkTime > DateTime.MinValue)
                            {
                                endtime = onduty.EndWorkTime;
                            }
                            //统计相关信息
                            //查询进场数
                            changeshift.Entrance_Count = iorecordfactory.EntranceCountByBox(box.BoxID, starttime, endtime);
                            //查询出场数
                            changeshift.Exit_Count = iorecordfactory.ExitCountByBox(box.BoxID, starttime, endtime);
                            #region 进场卡片类型
                            List <KeyValue> _InCardType = iorecordfactory.GetInCardTypeByBoxID(box.BoxID, starttime, endtime);
                            if (_InCardType != null && _InCardType.Count > 0)
                            {
                                foreach (var k in _InCardType)
                                {
                                    switch (k.KeyName)
                                    {
                                    case "0":
                                        changeshift.VIPCard = k.Key_Value;
                                        break;

                                    case "1":
                                        changeshift.StordCard = k.Key_Value;
                                        break;

                                    case "2":
                                        changeshift.MonthCard = k.Key_Value;
                                        break;

                                    case "3":
                                        changeshift.TempCard = k.Key_Value;
                                        break;

                                    case "4":
                                        changeshift.JobCard = k.Key_Value;
                                        break;

                                    default:
                                        break;
                                    }
                                }
                            }
                            #endregion

                            #region 统计放行类型
                            List <KeyValue> _ReleaseType = iorecordfactory.GetReleaseTypeByBox(box.BoxID, starttime, endtime);
                            if (_ReleaseType != null && _ReleaseType.Count > 0)
                            {
                                foreach (KeyValue k in _ReleaseType)
                                {
                                    switch (k.KeyName)
                                    {
                                    case "0":
                                        changeshift.ReleaseType_Normal = k.Key_Value;
                                        break;

                                    case "1":
                                        changeshift.ReleaseType_Charge = k.Key_Value;
                                        break;

                                    case "2":
                                        changeshift.ReleaseType_Free = k.Key_Value;
                                        break;

                                    case "3":
                                        changeshift.ReleaseType_Catch = k.Key_Value;
                                        break;
                                    }
                                }
                            }
                            #endregion

                            #region 统计费用相关
                            List <ParkOrder> _orderfee = iorder.GetOrdersByBoxID(parking.PKID, onduty.BoxID, starttime, endtime);
                            if (_orderfee != null && _orderfee.Count > 0)
                            {
                                foreach (ParkOrder o in _orderfee)
                                {
                                    changeshift.Receivable_Amount += o.Amount;
                                    changeshift.Diff_Amount       += o.UnPayAmount;
                                    changeshift.Real_Amount        = (changeshift.Receivable_Amount - changeshift.Diff_Amount);
                                    //支付方式(1.现金、2.微信、3.支付宝、4.网银、5.电子钱包、6.优免卷7.余额
                                    switch (o.PayWay)
                                    {
                                    case OrderPayWay.Cash:
                                        changeshift.Cash_Amount += o.PayAmount;
                                        changeshift.Cash_Count++;

                                        if (o.DiscountAmount > 0)
                                        {
                                            changeshift.CashDiscount_Amount += o.DiscountAmount;
                                            changeshift.CashDiscount_Count++;

                                            changeshift.Discount_Amount += o.DiscountAmount;
                                            changeshift.Discount_Count++;
                                        }
                                        break;

                                    case OrderPayWay.WeiXin:
                                    case OrderPayWay.Alipay:
                                    case OrderPayWay.OnlineBanking:
                                    case OrderPayWay.Wallet:
                                        changeshift.OnLine_Amount += o.PayAmount;
                                        changeshift.OnLine_Count++;

                                        if (o.DiscountAmount > 0)
                                        {
                                            changeshift.OnLineDiscount_Amount += o.DiscountAmount;
                                            changeshift.OnLineDiscount_Count++;

                                            changeshift.Discount_Amount += o.DiscountAmount;
                                            changeshift.Discount_Count++;
                                        }
                                        break;

                                    case OrderPayWay.PreferentialTicket:
                                        changeshift.Discount_Amount += o.DiscountAmount;
                                        changeshift.Discount_Count++;
                                        break;

                                    case OrderPayWay.ValueCard:
                                        changeshift.StordCard_Amount += o.PayAmount;
                                        changeshift.StordCard_Count++;
                                        break;
                                    }
                                    switch (o.OrderType)
                                    {
                                    //临时卡缴费
                                    case OrderType.TempCardPayment:
                                    case OrderType.AreaTempCardPayment:
                                        switch (o.PayWay)
                                        {
                                        case OrderPayWay.WeiXin:
                                        case OrderPayWay.Alipay:
                                        case OrderPayWay.OnlineBanking:
                                        case OrderPayWay.Wallet:
                                            changeshift.OnLineTemp_Amount += o.PayAmount;
                                            changeshift.OnLineTemp_Count++;
                                            break;

                                        default:
                                            changeshift.Temp_Amount += o.PayAmount;
                                            changeshift.Temp_Count++;
                                            break;
                                        }
                                        break;

                                    //月卡续期
                                    case OrderType.MonthCardPayment:
                                        switch (o.PayWay)
                                        {
                                        case OrderPayWay.WeiXin:
                                        case OrderPayWay.Alipay:
                                        case OrderPayWay.OnlineBanking:
                                        case OrderPayWay.Wallet:
                                            changeshift.OnLineMonthCardExtend_Amount += o.PayAmount;
                                            changeshift.OnLineMonthCardExtend_Count++;
                                            break;

                                        default:
                                            changeshift.MonthCardExtend_Amount += o.PayAmount;
                                            changeshift.MonthCardExtend_Count++;
                                            break;
                                        }
                                        break;

                                    //VIP卡续期
                                    case OrderType.VIPCardRenewal:
                                        changeshift.VIPExtend_Count++;
                                        break;

                                    //储值卡充值
                                    case OrderType.ValueCardRecharge:
                                        switch (o.PayWay)
                                        {
                                        case OrderPayWay.WeiXin:
                                        case OrderPayWay.Alipay:
                                        case OrderPayWay.OnlineBanking:
                                        case OrderPayWay.Wallet:
                                            changeshift.OnLineStordCard_Amount += o.PayAmount;
                                            changeshift.OnLineStordCard_Count++;
                                            break;

                                        default:
                                            changeshift.StordCardRecharge_Amount += o.PayAmount;
                                            changeshift.StordCardRecharge_Count++;
                                            break;
                                        }
                                        break;
                                    }
                                }
                            }
                            #endregion
                            using (DbOperator dboperator = ConnectionManager.CreateReadConnection())
                            {
                                try
                                {
                                    dboperator.BeginTransaction();
                                    istatisticschangeshift.Delete(onduty.RecordID, dboperator);
                                    istatisticschangeshift.Insert(changeshift, dboperator);
                                    dboperator.CommitTransaction();
                                }
                                catch (Exception ex)
                                {
                                    TxtLogServices.WriteTxtLog("添加当班信息异常 异常信息:{0}", ex.Message);
                                    dboperator.RollbackTransaction();
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                TxtLogServices.WriteTxtLog("当班统计异常 异常信息:{0}", ex.Message);
            }
        }
Exemplo n.º 20
0
        /// <summary>
        /// 停车时长统计
        /// </summary>
        public void Statistics_LongTime(DateTime start, DateTime end)
        {
            try
            {
                IParking      iparking        = ParkingFactory.GetFactory();
                IParkIORecord iorecordfactory = ParkIORecordFactory.GetFactory();
                IStatistics_GatherLongTime gatherlongtimefactory = Statistics_GatherLongTimeFactory.GetFactory();
                string strerror           = string.Empty;
                List <BaseParkinfo> parks = iparking.QueryParkingAll();
                //取得所有有效车场
                if (parks != null && parks.Count > 0)
                {
                    foreach (BaseParkinfo park in parks)
                    {
                        if (park.IsOnLineGathe == YesOrNo.Yes)
                        {
                            continue;
                        }

                        //近7天的统计数据. 如果没有则补上.
                        int loop = (end - start).Days;
                        while (loop >= 0)
                        {
                            #region 变量
                            DateTime dtNow      = end;
                            DateTime GatherTime = DateTime.Parse(dtNow.AddDays(-1 - loop).ToString("yyyy-MM-dd 00:00:00"));
                            DateTime EndTime    = DateTime.Parse(dtNow.AddDays(-1 - loop).ToString("yyyy-MM-dd 23:59:59"));
                            int      longtime1  = 0;
                            int      longtime2  = 0;
                            int      longtime3  = 0;
                            int      longtime4  = 0;
                            int      longtime5  = 0;
                            int      longtime6  = 0;
                            int      longtime7  = 0;
                            int      longtime8  = 0;
                            int      longtime9  = 0;
                            int      longtime10 = 0;
                            int      longtime11 = 0;
                            int      longtime12 = 0;
                            int      longtime13 = 0;
                            int      longtime14 = 0;
                            int      longtime15 = 0;
                            int      longtime16 = 0;
                            int      longtime17 = 0;
                            int      longtime18 = 0;
                            int      longtime19 = 0;
                            int      longtime20 = 0;
                            int      longtime21 = 0;
                            int      longtime22 = 0;
                            int      longtime23 = 0;
                            int      longtime24 = 0;
                            #endregion

                            #region 判断是否已统计过
                            //判断统计数据是否存在.
                            if (gatherlongtimefactory.IsExists(park.PKID, GatherTime))
                            {
                                loop--;
                                continue;
                            }
                            #endregion

                            #region 获取记录并生成统计数据
                            List <ParkIORecord> iorecordlist = iorecordfactory.GetCarEntranceTimeAndExitTime(park.PKID, GatherTime, EndTime);
                            if (iorecordlist != null && iorecordlist.Count > 0)
                            {
                                foreach (ParkIORecord record in iorecordlist)
                                {
                                    int CarInHour = 0;
                                    if (record.EntranceTime == DateTime.MinValue)
                                    {
                                        CarInHour = 24;
                                    }
                                    else
                                    {
                                        if (record.ExitTime == DateTime.MinValue)
                                        {
                                            record.ExitTime = EndTime;
                                        }
                                        TimeSpan ts = EndTime - record.EntranceTime;
                                        CarInHour = System.Convert.ToInt32(Math.Ceiling(ts.Seconds / 3600.0));
                                    }
                                    switch (CarInHour)
                                    {
                                    case 1:
                                        longtime1++;
                                        break;

                                    case 2:
                                        longtime2++;
                                        break;

                                    case 3:
                                        longtime3++;
                                        break;

                                    case 4:
                                        longtime4++;
                                        break;

                                    case 5:
                                        longtime5++;
                                        break;

                                    case 6:
                                        longtime6++;
                                        break;

                                    case 7:
                                        longtime7++;
                                        break;

                                    case 8:
                                        longtime8++;
                                        break;

                                    case 9:
                                        longtime9++;
                                        break;

                                    case 10:
                                        longtime10++;
                                        break;

                                    case 11:
                                        longtime11++;
                                        break;

                                    case 12:
                                        longtime12++;
                                        break;

                                    case 13:
                                        longtime13++;
                                        break;

                                    case 14:
                                        longtime14++;
                                        break;

                                    case 15:
                                        longtime15++;
                                        break;

                                    case 16:
                                        longtime16++;
                                        break;

                                    case 17:
                                        longtime17++;
                                        break;

                                    case 18:
                                        longtime18++;
                                        break;

                                    case 19:
                                        longtime19++;
                                        break;

                                    case 20:
                                        longtime20++;
                                        break;

                                    case 21:
                                        longtime21++;
                                        break;

                                    case 22:
                                        longtime22++;
                                        break;

                                    case 23:
                                        longtime23++;
                                        break;

                                    case 24:
                                        longtime24++;
                                        break;
                                    }
                                }

                                #region 插入统计数据
                                string strSql = "insert into statistics_gatherlongtime(ParkingID,RecordID,GatherTime,LTime,Times,HaveUpdate,LastUpdateTime)"
                                                + " select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',1," + longtime1 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',2," + longtime2 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',3," + longtime3 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',4," + longtime4 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',5," + longtime5 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',6," + longtime6 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',7," + longtime7 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',8," + longtime8 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',9," + longtime9 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',10," + longtime10 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',11," + longtime11 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',12," + longtime12 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',13," + longtime13 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',14," + longtime14 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',15," + longtime15 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',16," + longtime16 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',17," + longtime17 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',18," + longtime18 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',19," + longtime19 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',20," + longtime20 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',21," + longtime21 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',22," + longtime22 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',23," + longtime23 + ",1,getdate()"
                                                + " union select '" + park.PKID + "','" + System.Guid.NewGuid().ToString() + "','" + GatherTime + "',24," + longtime24 + ",1,getdate()";
                                if (!gatherlongtimefactory.Insert(strSql))
                                {
                                    TxtLogServices.WriteTxtLog("插入停车时长统计信息异常 Sql:" + strSql);
                                }
                                #endregion
                            }
                            #endregion
                            loop--;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                TxtLogServices.WriteTxtLog("统计停车时长信息异常 异常信息:" + ex.Message);
            }
        }