Ejemplo n.º 1
0
        public JsonResult GetMyTakeAudit(int status)
        {
            var result = new ReturnMessage(false)
            {
                Message = "获取失败!"
            };

            try
            {
                TakeAuditOrderEntity para = new TakeAuditOrderEntity();
                if (status != -1)
                {
                    para.Status = status;
                }
                para.MemberId = LoginUser.UserId;
                para.sidx     = "CreateTime";
                para.sord     = "desc";
                var list = TakeAuditOrderBLL.Instance.GetList(para);
                list.Foreach((o) =>
                {
                    if (o.Status != null)
                    {
                        o.StatusName = ((QX360.Model.Enums.PaySatus)o.Status).ToString();
                    }
                    if (o.OrganizationId != null)
                    {
                        o.Audit = AuditOrganizationBLL.Instance.GetEntity(o.OrganizationId);
                        if (o.Audit != null)
                        {
                            if (o.Audit.ProvinceId != null)
                            {
                                o.Audit.ProvinceName = AreaBLL.Instance.GetEntity(o.Audit.ProvinceId).AreaName;
                            }
                            if (o.Audit.CityId != null)
                            {
                                o.Audit.CityName = AreaBLL.Instance.GetEntity(o.Audit.CityId).AreaName;
                            }
                            if (o.Audit.CountyId != null)
                            {
                                o.Audit.CountyName = AreaBLL.Instance.GetEntity(o.Audit.CountyId).AreaName;
                            }
                            o.Audit.AddressInfo = o.Audit.ProvinceName + o.Audit.CityName + o.Audit.CountyName + o.Audit.AddressInfo;
                        }
                    }
                });
                result.IsSuccess          = true;
                result.Message            = "获取成功";
                result.ResultData["List"] = list;
            }
            catch (Exception ex)
            {
                ex.Data["Method"] = "TakeAuditController>>GetMyAudit";
                new ExceptionHelper().LogException(ex);
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public JsonResult Cancel(string id)
        {
            var result = new ReturnMessage(false)
            {
                Message = "操作失败!"
            };

            try
            {
                TakeAuditOrderEntity entity = new TakeAuditOrderEntity();
                entity.TakeAuditOrderId = id;
                entity.Status           = (int)QX360.Model.Enums.PaySatus.已取消;
                TakeAuditOrderBLL.Instance.Update(entity);
                result.IsSuccess = true;
                result.Message   = "取消成功";
            }
            catch (Exception ex)
            {
                ex.Data["Method"] = "TakeAuditController>>Cancel";
                new ExceptionHelper().LogException(ex);
            }
            return(Json(result));
        }
Ejemplo n.º 3
0
        public ActionResult GetPageListJson(Pagination pagination, string queryJson)
        {
            var watch = CommonHelper.TimerStart();
            TakeAuditOrderEntity para = new TakeAuditOrderEntity();

            if (!string.IsNullOrWhiteSpace(queryJson))
            {
                var queryParam = queryJson.ToJObject();

                //类型
                if (!queryParam["condition"].IsEmpty() && !queryParam["keyword"].IsEmpty())
                {
                    var condition = queryParam["condition"].ToString().ToLower();
                    switch (condition)
                    {
                    case "takeauditorderno":
                        para.TakeAuditOrderNo = queryParam["keyword"].ToString();
                        break;

                    case "membername":
                        para.MemberName = queryParam["keyword"].ToString();
                        break;

                    case "mobile":
                        para.Mobile = queryParam["keyword"].ToString();
                        break;

                    case "organizationname":
                        para.OrganizationName = queryParam["keyword"].ToString();
                        break;
                    }
                }
                if (!queryParam["status"].IsEmpty())
                {
                    para.Status = int.Parse(queryParam["status"].ToString());
                }
            }

            var pageList = TakeAuditOrderBLL.Instance.GetPageList(para, ref pagination);

            if (pageList != null)
            {
                pageList.ForEach((o) =>
                {
                    if (o.ProvinceId != null)
                    {
                        o.ProvinceName = AreaBLL.Instance.GetEntity(o.ProvinceId).AreaName;
                    }
                    if (o.CityId != null)
                    {
                        o.CityName = AreaBLL.Instance.GetEntity(o.CityId).AreaName;
                    }
                    if (o.CountyId != null)
                    {
                        o.CountyName = AreaBLL.Instance.GetEntity(o.CountyId).AreaName;
                    }
                    o.AddressInfo = o.ProvinceName + o.CityName + o.CountyName + o.AddressInfo;

                    if (o.Status != null)
                    {
                        o.StatusName = ((RCHL.Model.Enums.PaySatus)o.Status).ToString();
                    }
                    if (o.CashType != null)
                    {
                        o.CashTypeName = ((RCHL.Model.Enums.CashType)o.CashType).ToString();
                    }
                    if (o.ServiceDate != null)
                    {
                        o.ServiceTime = Converter.ParseDateTime(o.ServiceDate).ToString("yyyy-MM-dd") + " " + o.ServiceTime;
                    }
                });
            }
            var JsonData = new
            {
                rows     = pageList,
                total    = pagination.total,
                page     = pagination.page,
                records  = pagination.records,
                costtime = CommonHelper.TimerEnd(watch)
            };

            return(Content(JsonData.ToJson()));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 导出EXCEL
        /// </summary>
        /// <param name="queryJson"></param>
        public void ExportExcel(string queryJson)
        {
            string cacheKey = Request["cacheid"] as string;

            HttpRuntime.Cache[cacheKey + "-state"] = "processing";
            HttpRuntime.Cache[cacheKey + "-row"]   = "0";
            try
            {
                TakeAuditOrderEntity para = new TakeAuditOrderEntity();
                if (!string.IsNullOrWhiteSpace(queryJson))
                {
                    //这里要url解码
                    var queryParam = Server.UrlDecode(queryJson).ToJObject();
                    //类型
                    if (!queryParam["condition"].IsEmpty() && !queryParam["keyword"].IsEmpty())
                    {
                        var condition = queryParam["condition"].ToString().ToLower();
                        switch (condition)
                        {
                        case "TakeAuditOrderno":
                            para.TakeAuditOrderNo = queryParam["keyword"].ToString();
                            break;

                        case "membername":
                            para.MemberName = queryParam["keyword"].ToString();
                            break;

                        case "mobile":
                            para.Mobile = queryParam["keyword"].ToString();
                            break;

                        case "organizationname":
                            para.OrganizationName = queryParam["keyword"].ToString();
                            break;
                        }
                    }
                    if (!queryParam["status"].IsEmpty())
                    {
                        para.Status = int.Parse(queryParam["status"].ToString());
                    }
                }

                var list = TakeAuditOrderBLL.Instance.GetList(para);
                if (list != null)
                {
                    list.ForEach((o) =>
                    {
                        if (o.ProvinceId != null)
                        {
                            o.ProvinceName = AreaBLL.Instance.GetEntity(o.ProvinceId).AreaName;
                        }
                        if (o.CityId != null)
                        {
                            o.CityName = AreaBLL.Instance.GetEntity(o.CityId).AreaName;
                        }
                        if (o.CountyId != null)
                        {
                            o.CountyName = AreaBLL.Instance.GetEntity(o.CountyId).AreaName;
                        }
                        o.AddressInfo = o.ProvinceName + o.CityName + o.CountyName + o.AddressInfo;

                        if (o.ServiceDate != null)
                        {
                            o.ServiceTime = Converter.ParseDateTime(o.ServiceDate).ToString("yyyy-MM-dd") + " " + o.ServiceTime;
                        }
                        if (o.Status != null)
                        {
                            o.StatusName = ((RCHL.Model.Enums.StudySubscribeStatus)o.Status).ToString();
                        }
                        if (o.CashType != null)
                        {
                            o.CashTypeName = ((RCHL.Model.Enums.CashType)o.CashType).ToString();
                        }
                    });

                    //设置导出格式
                    ExcelConfig excelconfig = new ExcelConfig();
                    excelconfig.Title           = "代审订单";
                    excelconfig.TitleFont       = "微软雅黑";
                    excelconfig.TitlePoint      = 10;
                    excelconfig.FileName        = "代审订单.xls";
                    excelconfig.IsAllSizeColumn = true;
                    //每一列的设置,没有设置的列信息,系统将按datatable中的列名导出
                    List <ColumnEntity> listColumnEntity = new List <ColumnEntity>();
                    excelconfig.ColumnEntity = listColumnEntity;
                    ColumnEntity columnentity = new ColumnEntity();
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "TakeAuditOrderNo", ExcelColumn = "订单号", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "MemberName", ExcelColumn = "用户名", Width = 15
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "Mobile", ExcelColumn = "联系方式", Width = 15
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "AddressInfo", ExcelColumn = "地址", Width = 15
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "CarTypeName", ExcelColumn = "车辆类型", Width = 15
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "CarNum", ExcelColumn = "车牌号", Width = 15
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "ServiceTime", ExcelColumn = "预约时间", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "Price", ExcelColumn = "费用", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "CashTypeName", ExcelColumn = "支付方式", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "OrganizationName", ExcelColumn = "年检机构", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "StatusName", ExcelColumn = "状态", Width = 20
                    });
                    //需合并索引
                    //excelconfig.MergeRangeIndexArr = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };

                    //调用导出方法
                    ExcelHelper <TakeAuditOrderEntity> .ExcelDownload(list, excelconfig);

                    HttpRuntime.Cache[cacheKey + "-state"] = "done";
                }
            }
            catch (Exception)
            {
                HttpRuntime.Cache[cacheKey + "-state"] = "error";
            }
        }
Ejemplo n.º 5
0
        public ActionResult GetPageListJson(Pagination pagination, string queryJson)
        {
            var watch = CommonHelper.TimerStart();
            TakeAuditOrderEntity para = new TakeAuditOrderEntity();

            if (!string.IsNullOrWhiteSpace(queryJson))
            {
                var queryParam = queryJson.ToJObject();
                if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty())
                {
                    DateTime startTime = queryParam["StartTime"].ToDate();
                    DateTime endTime   = queryParam["EndTime"].ToDate();
                    para.StartTime = startTime.ToString();
                    para.EndTime   = endTime.ToString();
                }
                //类型
                if (!queryParam["condition"].IsEmpty() && !queryParam["keyword"].IsEmpty())
                {
                    var condition = queryParam["condition"].ToString().ToLower();
                    switch (condition)
                    {
                    case "membername":
                        para.MemberName = queryParam["keyword"].ToString();
                        break;

                    case "cartypename":
                        para.CarTypeName = queryParam["keyword"].ToString();
                        break;

                    case "carnum":
                        para.CarNum = queryParam["keyword"].ToString();
                        break;

                    case "organizationname":
                        para.OrganizationName = queryParam["keyword"].ToString();
                        break;
                    }
                }

                if (!queryParam["TimeSpace"].IsEmpty())
                {
                    para.ServiceTime = queryParam["TimeSpace"].ToString();
                }
            }
            para.NotStatus = (int)QX360.Model.Enums.PaySatus.已取消;
            var pageList = new List <TakeAuditOrderEntity>();

            try
            {
                pageList = TakeAuditOrderBLL.Instance.GetPageList(para, ref pagination);
                pageList.ForEach((o) =>
                {
                    if (o.ProvinceId != null)
                    {
                        o.ProvinceName = AreaBLL.Instance.GetEntity(o.ProvinceId).AreaName;
                    }
                    if (o.CityId != null)
                    {
                        o.CityName = AreaBLL.Instance.GetEntity(o.CityId).AreaName;
                    }
                    if (o.CountyId != null)
                    {
                        o.CountyName = AreaBLL.Instance.GetEntity(o.CountyId).AreaName;
                    }
                    o.AddressInfo = o.ProvinceName + o.CityName + o.CountyName + o.AddressInfo;
                });
            }
            catch (Exception ex)
            {
            }
            var JsonData = new
            {
                rows     = pageList,
                total    = pagination.total,
                page     = pagination.page,
                records  = pagination.records,
                costtime = CommonHelper.TimerEnd(watch)
            };

            return(Content(JsonData.ToJson()));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 导出EXCEL
        /// </summary>
        public void ExportExcel(string queryJson)
        {
            string cacheKey = Request["cacheid"] as string;

            HttpRuntime.Cache[cacheKey + "-state"] = "processing";
            HttpRuntime.Cache[cacheKey + "-row"]   = "0";
            TakeAuditOrderEntity para = new TakeAuditOrderEntity();

            try
            {
                //这里要url解码
                var queryParam = Server.UrlDecode(queryJson).ToJObject();
                if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty())
                {
                    DateTime startTime = queryParam["StartTime"].ToDate();
                    DateTime endTime   = queryParam["EndTime"].ToDate();
                    para.StartTime = startTime.ToString();
                    para.EndTime   = endTime.ToString();
                }
                //类型
                if (!queryParam["condition"].IsEmpty() && !queryParam["keyword"].IsEmpty())
                {
                    var condition = queryParam["condition"].ToString().ToLower();
                    switch (condition)
                    {
                    case "membername":
                        para.MemberName = queryParam["keyword"].ToString();
                        break;

                    case "cartypename":
                        para.CarTypeName = queryParam["keyword"].ToString();
                        break;

                    case "carnum":
                        para.CarNum = queryParam["keyword"].ToString();
                        break;

                    case "organizationname":
                        para.OrganizationName = queryParam["keyword"].ToString();
                        break;
                    }
                }

                if (!queryParam["TimeSpace"].IsEmpty())
                {
                    para.ServiceTime = queryParam["TimeSpace"].ToString();
                }
                para.NotStatus = (int)QX360.Model.Enums.PaySatus.已取消;
                var list = TakeAuditOrderBLL.Instance.GetList(para);
                if (list != null)
                {
                    list.ForEach((o) =>
                    {
                        if (o.ProvinceId != null)
                        {
                            o.ProvinceName = AreaBLL.Instance.GetEntity(o.ProvinceId).AreaName;
                        }
                        if (o.CityId != null)
                        {
                            o.CityName = AreaBLL.Instance.GetEntity(o.CityId).AreaName;
                        }
                        if (o.CountyId != null)
                        {
                            o.CountyName = AreaBLL.Instance.GetEntity(o.CountyId).AreaName;
                        }
                        o.AddressInfo = o.ProvinceName + o.CityName + o.CountyName + o.AddressInfo;
                    });

                    //设置导出格式
                    ExcelConfig excelconfig = new ExcelConfig();
                    excelconfig.Title           = "代审车辆预约明细报表";
                    excelconfig.TitleFont       = "微软雅黑";
                    excelconfig.TitlePoint      = 10;
                    excelconfig.FileName        = "代审车辆预约明细报表.xls";
                    excelconfig.IsAllSizeColumn = true;
                    //每一列的设置,没有设置的列信息,系统将按datatable中的列名导出
                    List <ColumnEntity> listColumnEntity = new List <ColumnEntity>();
                    excelconfig.ColumnEntity = listColumnEntity;
                    ColumnEntity columnentity = new ColumnEntity();
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "MemberName", ExcelColumn = "用户名", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "CarNum", ExcelColumn = "车牌号", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "CarTypeName", ExcelColumn = "车辆类型", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "Mobile", ExcelColumn = "联系电话", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "AddressInfo", ExcelColumn = "上门地址", Width = 20
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "ServiceDate", ExcelColumn = "预约时间", Width = 15
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "ServiceTime", ExcelColumn = "预约时段", Width = 15
                    });
                    excelconfig.ColumnEntity.Add(new ColumnEntity()
                    {
                        Column = "OrganizationName", ExcelColumn = "代审机构", Width = 15
                    });

                    //需合并索引
                    //excelconfig.MergeRangeIndexArr = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };

                    //调用导出方法
                    ExcelHelper <TakeAuditOrderEntity> .ExcelDownload(list, excelconfig);

                    HttpRuntime.Cache[cacheKey + "-state"] = "done";
                }
            }
            catch (Exception)
            {
                HttpRuntime.Cache[cacheKey + "-state"] = "error";
            }
        }