示例#1
0
        /// <summary>
        /// 获取小区信息
        /// </summary>
        /// <param name="Companyid"></param>
        /// <returns></returns>
        public string GetVillageData()
        {
            StringBuilder sb = new StringBuilder();

            try
            {
                int    pageIndex = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int    pageSize  = string.IsNullOrEmpty(Request.Params["rows"]) ? 0 : int.Parse(Request.Params["rows"]);
                string sort      = Request.Params["sort"];
                if (string.IsNullOrWhiteSpace(Request.Params["companyId"]))
                {
                    return(string.Empty);
                }

                if (GetLoginUserVillages.Count == 0)
                {
                    return(string.Empty);
                }

                string             companyId   = Request.Params["companyId"];
                int                totalRecord = 0;
                List <BaseVillage> list        = VillageServices.QueryPage(GetLoginUserVillages.Select(p => p.VID).ToList(), companyId, pageIndex, pageSize, out totalRecord);

                sb.Append("{");
                sb.Append("\"total\":" + totalRecord + ",");
                sb.Append("\"rows\":" + JsonHelper.GetJsonString(list) + ",");
                sb.Append("\"index\":" + pageIndex);
                sb.Append("}");
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "获取小区信息失败");
            }
            return(sb.ToString());
        }
示例#2
0
        /// <summary>
        /// 查询车场收入数据
        /// </summary>
        /// <returns></returns>
        public JsonResult Get_HomeData()
        {
            JsonResult json = new JsonResult();

            json.Data = StatisticsServices.GetHomeData(GetLoginUserVillages.Select(p => p.VID).ToList());
            return(json);
        }
示例#3
0
        public string GetSellerTreeData()
        {
            try
            {
                StringBuilder strTree = new StringBuilder();

                if (GetLoginUserVillages.Count == 0)
                {
                    return(strTree.ToString());
                }

                List <ParkSeller> sellers     = ParkSellerServices.QueryByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                BaseCompany       currCompany = GetLoginUserRoleCompany.FirstOrDefault(p => p.CPID == GetCurrentUserCompanyId);
                if (currCompany == null)
                {
                    return(string.Empty);
                }
                strTree.Append("[{\"id\":\"" + currCompany.CPID + "\",");
                strTree.Append("\"iconCls\":\"my-company-icon\",");
                strTree.Append("\"attributes\":{\"type\":0},");
                strTree.Append("\"text\":\"" + currCompany.CPName + "\"");
                GetVillageTree(sellers, currCompany.CPID, strTree);
                strTree.Append("}]");
                return(strTree.ToString());
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "构建商家树结构失败");
                return(string.Empty);
            }
        }
示例#4
0
        public ActionResult Index()
        {
            List <BaseParkinfo> parings = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());

            ViewBag.StartTime = DateTime.Now.AddDays(-7).Date.AddSeconds(1).ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T");
            ViewBag.EndTime   = DateTime.Now.Date.AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T");
            return(View(parings));
        }
示例#5
0
        /// <summary>
        /// 获得所有车场
        /// </summary>
        /// <returns></returns>
        public JsonResult GetSellers()
        {
            JsonResult json = new JsonResult();

            try
            {
                json.Data = ParkSellerServices.QueryByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
            }
            catch { }
            return(json);
        }
示例#6
0
        public ActionResult GetAduitMonthlyCarApplyData()
        {
            try
            {
                List <string> parkingIds = new List <string>();
                if (!string.IsNullOrEmpty(Request.Params["parkingId"]))
                {
                    parkingIds.Add(Request.Params["parkingId"].ToString());
                }
                else
                {
                    List <BaseParkinfo> parings = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                    parkingIds = parings.Select(p => p.PKID).ToList();
                }
                if (parkingIds.Count == 0)
                {
                    throw new MyException("获取车场编号失败");
                }

                string applyInfo = Request.Params["applyInfo"];

                DateTime startTime = DateTime.Parse(Request.Params["starttime"]);
                DateTime endTime   = DateTime.Parse(Request.Params["endtime"]);

                MonthlyCarApplyStatus?status = null;
                int intStatus = 0;
                if (!string.IsNullOrWhiteSpace(Request.Params["status"]) && int.TryParse(Request.Params["status"].ToString(), out intStatus))
                {
                    status = (MonthlyCarApplyStatus)intStatus;
                }
                int page = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int rows = 15;

                int total = 0;
                List <ParkMonthlyCarApply> models = ParkMonthlyCarApplyServices.QueryPage(parkingIds, applyInfo, status, startTime, endTime, rows, page, out total);

                var result = from p in models
                             select new
                {
                    ID             = p.ID,
                    RecordID       = p.RecordID,
                    PKID           = p.PKID,
                    CarTypeID      = p.CarTypeID,
                    CarModelID     = p.CarModelID,
                    ApplyName      = p.ApplyName,
                    ApplyMoblie    = p.ApplyMoblie,
                    PlateNo        = GetNullToEmpty(p.PlateNo),
                    PKLot          = GetNullToEmpty(p.PKLot),
                    FamilyAddress  = GetNullToEmpty(p.FamilyAddress),
                    ApplyRemark    = GetNullToEmpty(p.ApplyRemark),
                    ApplyStatus    = (int)p.ApplyStatus,
                    ApplyStatusDes = p.ApplyStatus.GetDescription(),
                    AuditRemark    = GetNullToEmpty(p.AuditRemark),
                    ApplyDateTime  = p.ApplyDateTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    CarTypeName    = p.CarTypeName,
                    CarModelName   = p.CarModelName,
                    PKName         = p.PKName,
                };

                return(Json(MyResult.Success("", result)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptionToDbAndTxt("AdminAduitCarApply", "获取月租车申请信息失败", ex, LogFrom.WeiXin);
                return(Json(MyResult.Error("获取月租车申请信息失败")));
            }
        }
示例#7
0
        public string GetParkingTreeData()
        {
            try
            {
                StringBuilder strParkingTree = new StringBuilder();
                if (GetLoginUserVillages.Count == 0)
                {
                    return(strParkingTree.ToString());
                }

                List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                strParkingTree.Append("[");
                int index = 1;
                foreach (var obj in GetLoginUserRoleCompany)
                {
                    //List<BaseVillage> childVillages = GetLoginUserVillages.Where(p => p.CPID == obj.CPID).ToList();
                    //if (childVillages.Count == 0) continue;

                    //List<BaseParkinfo> childParkings = parkings.Where(p => childVillages.Select(o => o.VID).Contains(p.VID)).ToList();
                    //if (childParkings.Count == 0) continue;
                    //if (index != 1)
                    //{
                    //    strParkingTree.Append(",");
                    //}
                    if (index != 1)
                    {
                        strParkingTree.Append(",");
                    }
                    strParkingTree.Append("{\"id\":\"" + obj.CPID + "\",");
                    strParkingTree.Append("\"iconCls\":\"my-company-icon\",");
                    strParkingTree.Append("\"attributes\":{\"type\":0},");
                    strParkingTree.Append("\"text\":\"" + obj.CPName + "\"");
                    GetVillageTreeData(obj.CPID, parkings, strParkingTree);
                    strParkingTree.Append("}");
                    index++;
                }
                strParkingTree.Append("]");
                return(strParkingTree.ToString());
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "构建车场树异常");
                return(string.Empty);
            }
        }
示例#8
0
        public string GetOnlyParkingTreeData()
        {
            try
            {
                StringBuilder strParkingTree = new StringBuilder();
                if (GetLoginUserVillages.Count == 0)
                {
                    return(strParkingTree.ToString());
                }

                List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                strParkingTree.Append("[");
                int index = 1;
                foreach (var item in parkings)
                {
                    strParkingTree.Append("{");
                    strParkingTree.AppendFormat("\"id\":\"{0}\"", item.PKID);
                    strParkingTree.Append(",\"iconCls\":\"my-parking-icon\"");
                    strParkingTree.AppendFormat(",\"text\":\"{0}\"", item.PKName);
                    strParkingTree.Append(",\"attributes\":{\"type\":1}");
                    strParkingTree.Append("}");
                    if (index != parkings.Count())
                    {
                        strParkingTree.Append(",");
                    }
                    index++;
                }
                strParkingTree.Append("]");
                return(strParkingTree.ToString());
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "构建车场树异常");
                return(string.Empty);
            }
        }
示例#9
0
        public string GetPrakAreaTreeData()
        {
            try
            {
                StringBuilder       strAreaTree = new StringBuilder();
                List <BaseParkinfo> parkings    = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                if (parkings.Count == 0)
                {
                    return(string.Empty);
                }

                List <ParkArea> parkAreas = ParkAreaServices.GetParkAreaByParkingIds(parkings.Select(p => p.PKID).ToList());

                strAreaTree.Append("[");
                int index = 1;
                foreach (var item in GetLoginUserVillages)
                {
                    BaseCompany company = GetLoginUserRoleCompany.FirstOrDefault(p => p.CPID == item.CPID);
                    if (company == null)
                    {
                        continue;
                    }

                    string text = string.Format("{0}【{1}】", item.VName, company.CPName);
                    strAreaTree.Append("{\"id\":\"" + item.VID + "\",");
                    strAreaTree.Append("\"iconCls\":\"my-village-icon\",");
                    strAreaTree.Append("\"attributes\":{\"type\":0},");
                    strAreaTree.Append("\"text\":\"" + text + "\"");
                    GetParkingTreeData(parkings, parkAreas, item.VID, strAreaTree);
                    strAreaTree.Append("}");
                    if (index != GetLoginUserVillages.Count)
                    {
                        strAreaTree.Append(",");
                    }
                    index++;
                }

                strAreaTree.Append("]");
                return(strAreaTree.ToString());
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "构建车场区域树失败");
                return(string.Empty);
            }
        }
示例#10
0
        public JsonResult QueryRemotelyOpenGateData()
        {
            try
            {
                List <string> parkingIds = new List <string>();
                if (!string.IsNullOrWhiteSpace(Request.Params["parkingId"]))
                {
                    parkingIds.Add(Request.Params["parkingId"]);
                }
                else
                {
                    List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                    if (parkings.Count > 0)
                    {
                        parkingIds.AddRange(parkings.Select(p => p.PKID));
                    }
                }
                string areaId = Request.Params["areaId"];
                string boxId  = Request.Params["boxId"];

                int page             = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int rows             = 15;
                int recordTotalCount = 0;
                List <RemotelyOpenGateView> models = ParkGateServices.QueryRemotelyOpenGate(parkingIds, areaId, boxId, page, rows, out recordTotalCount);
                return(Json(MyResult.Success("", models)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "微信获取远程开闸数据失败");
                return(Json(MyResult.Error("获取失败")));
            }
        }