Przeglądaj źródła

添加短信验证码接口
添加我的下载接口

DuGuYang 1 rok temu
rodzic
commit
10e9b052bf

+ 82 - 0
AppStart/OtherApi/SendSMS.cs

@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+using Library;
+
+namespace MySystem
+{
+    public class SendSMS
+    {
+        public readonly static SendSMS Instance = new SendSMS();
+        private SendSMS()
+        {
+        }
+
+
+        #region 发送短信验证码
+
+        private string host = "https://gyytz.market.alicloudapi.com";
+        private string path = "/sms/smsSend";
+        private string method = "POST";
+        private string appcode = "8e5704921ca3422f80f0deb935a7ddc6";
+
+        public string Do(string mobile, string code)
+        {
+            String querys = "mobile=" + mobile + "&param=**code**%3A" + code + "%2C**minute**%3A5&smsSignId=0f6eccbf0ff343029a7bffc144591fd8&templateId=908e94ccf08b4476ba6c876d13f084ad";
+            String bodys = "";
+            String url = host + path;
+            HttpWebRequest httpRequest = null;
+            HttpWebResponse httpResponse = null;
+
+            if (0 < querys.Length)
+            {
+                url = url + "?" + querys;
+            }
+
+            if (host.Contains("https://"))
+            {
+                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
+                httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
+            }
+            else
+            {
+                httpRequest = (HttpWebRequest)WebRequest.Create(url);
+            }
+            httpRequest.Method = method;
+            httpRequest.Headers.Add("Authorization", "APPCODE " + appcode);
+            if (0 < bodys.Length)
+            {
+                byte[] data = Encoding.UTF8.GetBytes(bodys);
+                using (Stream stream = httpRequest.GetRequestStream())
+                {
+                    stream.Write(data, 0, data.Length);
+                }
+            }
+            try
+            {
+                httpResponse = (HttpWebResponse)httpRequest.GetResponse();
+            }
+            catch (WebException ex)
+            {
+                httpResponse = (HttpWebResponse)ex.Response;
+            }
+
+            Stream st = httpResponse.GetResponseStream();
+            StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
+            string result = reader.ReadToEnd();
+            return result;
+        }
+
+        public bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
+        {
+            return true;
+        }
+
+        #endregion
+    }
+}

+ 16 - 16
Areas/Api/Controllers/v1/Main1/ConsumerProfitController.cs

@@ -41,22 +41,22 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             var orderId = int.Parse(OrderId);
             var order = ConsumerOrdersService.Query(orderId);
             var Status = 0;
-            if (order.IsAct == 0 && order.DivideFlag == 0)
-            {
-                Status = -1;
-            }
-            if (order.IsAct == 1 && order.DivideFlag == 0)
-            {
-                Status = 0;
-            }
-            if (order.IsAct == 1 && order.DivideFlag == 1)
-            {
-                Status = 2;
-            }
-            if (order.IsAct == 1 && order.DivideFlag == 2)
-            {
-                Status = 1;
-            }
+            // if (order.IsAct == 0 && order.DivideFlag == 0)
+            // {
+            //     Status = -1;
+            // }
+            // if (order.IsAct == 1 && order.DivideFlag == 0)
+            // {
+            //     Status = 0;
+            // }
+            // if (order.IsAct == 1 && order.DivideFlag == 1)
+            // {
+            //     Status = 2;
+            // }
+            // if (order.IsAct == 1 && order.DivideFlag == 2)
+            // {
+            //     Status = 1;
+            // }
             List<RelationData> relationData = new List<RelationData>();
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
             List<Dictionary<string, object>> source = ConsumerProfitService.List(relationData, " and OrderId=" + orderId + "", pageNum, pageSize);

+ 77 - 0
Areas/Api/Controllers/v1/Main1/ExportExcelsController.cs

@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using Microsoft.AspNetCore.Authorization;
+using System.Web;
+using MySystem.Models.Main1;
+using MySystem.Service.Main1;
+using LitJson;
+using Library;
+
+namespace MySystem.Areas.Api.Controllers.v1.Main1
+{
+    [Area("Api")]
+    [Route("/v1/QrCodePlateMain/[controller]/[action]")]
+    public class ExportExcelsController : BaseController
+    {
+        public ExportExcelsController(IHttpContextAccessor accessor) : base(accessor)
+        {
+        }
+
+
+        #region 我的下载-我的下载
+        [Authorize]
+        public JsonResult DownloadsList(string value)
+        {
+            value = PublicFunction.DesDecrypt(value); ;
+            JsonData data = JsonMapper.ToObject(value);
+            List<Dictionary<string, object>> dataList = DownloadsListDo(value);
+            return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
+        }
+        private List<Dictionary<string, object>> DownloadsListDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            string CreateDate = data["CreateDate"].ToString(); //创建时间
+            string FileName = data["FileName"].ToString(); //文件名
+            string FileUrl = data["FileUrl"].ToString(); //文件路径
+            int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
+            int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
+            string condition = "";
+            if (!string.IsNullOrEmpty(CreateDate))
+            {
+                string[] datelist = CreateDate.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+            if (!string.IsNullOrEmpty(FileName))
+            {
+                condition += " and FileName like '%" + FileName + "%'";
+            }
+            if (!string.IsNullOrEmpty(FileUrl))
+            {
+                condition += " and FileUrl like '%" + FileUrl + "%'";
+            }
+            List<RelationData> relationData = new List<RelationData>();
+            List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
+            List<Dictionary<string, object>> source = ExportExcelsService.List(relationData, condition, pageNum, pageSize);
+            foreach (Dictionary<string, object> subdata in source)
+            {
+                Dictionary<string, object> curData = new Dictionary<string, object>();
+                curData.Add("Id", subdata["Id"].ToString()); //记录Id
+                curData.Add("CreateDate", subdata["CreateDate"].ToString() == "" ? "" : DateTime.Parse(subdata["CreateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //创建时间
+                curData.Add("FileName", subdata["FileName"].ToString()); //文件名
+                curData.Add("FileUrl", subdata["FileUrl"].ToString()); //文件路径
+
+                dataList.Add(curData);
+            }
+            return dataList;
+        }
+        #endregion
+
+    }
+}

+ 3 - 3
Areas/Api/Controllers/v1/Main1/MerchantInfoController.cs

@@ -137,12 +137,12 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             {
                 return new AppResultJson() { Status = "-1", Info = "手机号不正确" };
             }
-            MobileCodeCheck mobilecheck = RedisDbconn.Instance.Get<MobileCodeCheck>("MobileCodeCheck:" + Mobile);
-            if (mobilecheck == null)
+            var mobilecheck = RedisDbconn.Instance.Get<string>("MobileCodeCheck:" + Mobile);
+            if (mobilecheck == "")
             {
                 return new AppResultJson() { Status = "-1", Info = "短信验证码不正确" };
             }
-            if (mobilecheck.CheckCode != MobileCode)
+            if (mobilecheck != MobileCode)
             {
                 return new AppResultJson() { Status = "-1", Info = "短信验证码不正确" };
             }

+ 54 - 0
Areas/Api/Controllers/v1/Main1/MobileCodeCheckController.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using Microsoft.AspNetCore.Authorization;
+using System.Web;
+using LitJson;
+using Library;
+
+namespace MySystem.Areas.Api.Controllers.v1
+{
+    [Area("Api")]
+    [Route("Api/v1/[controller]/[action]")]
+    public class MobileCodeCheckController : BaseController
+    {
+        public MobileCodeCheckController(IHttpContextAccessor accessor) : base(accessor)
+        {
+        }
+
+
+
+        #region 我的-发送验证码
+        // [Authorize]
+        public JsonResult SendSms(string value)
+        {
+            value = DesDecrypt(value);
+            JsonData data = JsonMapper.ToObject(value);
+            AppResultJson result = SendSmsDo(value);
+            return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
+        }
+        public AppResultJson SendSmsDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            Dictionary<string, object> Obj = new Dictionary<string, object>();
+            string Mobile = data["Mobile"].ToString(); //手机号
+            string check = RedisDbconn.Instance.Get<string>("MobileCodeCheck:" + Mobile);
+            if (check == "")
+            { 
+                return new AppResultJson() { Status = "1", Info = "", Data = Obj };
+            }
+            string CheckCode = function.get_Random(6);
+            RedisDbconn.Instance.Set("MobileCodeCheck:" + Mobile, CheckCode);
+            RedisDbconn.Instance.SetExpire("MobileCodeCheck:" + Mobile, 300);
+
+            SendSMS.Instance.Do(Mobile, CheckCode); //发送短信
+            return new AppResultJson() { Status = "1", Info = "", Data = Obj };
+        }
+        #endregion
+
+    }
+}

+ 24 - 0
Models/Main1/CustomQuery.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main1
+{
+    public partial class CustomQuery
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string AdminNames { get; set; }
+        public string Title { get; set; }
+        public string SqlContent { get; set; }
+    }
+}

+ 21 - 0
Models/Main1/ExportExcels.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main1
+{
+    public partial class ExportExcels
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string FileName { get; set; }
+        public int SysId { get; set; }
+        public string FileUrl { get; set; }
+    }
+}

+ 123 - 8
Models/Main1/WebCMSEntities.cs

@@ -48,8 +48,10 @@ namespace MySystem.Models.Main1
         public virtual DbSet<CouponAssignRecords> CouponAssignRecords { get; set; }
         public virtual DbSet<Coupons> Coupons { get; set; }
         public virtual DbSet<CouponsForUser> CouponsForUser { get; set; }
+        public virtual DbSet<CustomQuery> CustomQuery { get; set; }
         public virtual DbSet<CustomTagSet> CustomTagSet { get; set; }
         public virtual DbSet<ErpCompanys> ErpCompanys { get; set; }
+        public virtual DbSet<ExportExcels> ExportExcels { get; set; }
         public virtual DbSet<FileUpdateInfo> FileUpdateInfo { get; set; }
         public virtual DbSet<FluxProfitDetail> FluxProfitDetail { get; set; }
         public virtual DbSet<FluxProfitSummary> FluxProfitSummary { get; set; }
@@ -2258,14 +2260,6 @@ namespace MySystem.Models.Main1
 
                 entity.Property(e => e.CurDivi).HasColumnType("decimal(18,2)");
 
-                entity.Property(e => e.DivideDate)
-                    .HasColumnType("datetime")
-                    .HasComment("提交分账时间");
-
-                entity.Property(e => e.DivideFlag)
-                    .HasColumnType("int(11)")
-                    .HasComment("分账标记");
-
                 entity.Property(e => e.DivideLog)
                     .HasColumnType("mediumtext")
                     .HasComment("分账结果日志")
@@ -2752,6 +2746,82 @@ namespace MySystem.Models.Main1
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<CustomQuery>(entity =>
+            {
+                entity.HasComment("自定义查询");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AdminNames)
+                    .HasColumnType("varchar(500)")
+                    .HasComment("后台账号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创建人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.SqlContent)
+                    .HasColumnType("mediumtext")
+                    .HasComment("sql语句")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.Title)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("标题")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<CustomTagSet>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -2866,6 +2936,48 @@ namespace MySystem.Models.Main1
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<ExportExcels>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.FileName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.FileUrl)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.SysId).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
             modelBuilder.Entity<FileUpdateInfo>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -16385,6 +16497,9 @@ namespace MySystem.Models.Main1
 
             modelBuilder.Entity<UserAmountSummary>(entity =>
             {
+                entity.HasIndex(e => new { e.UserId, e.IsAct, e.TradeMonth, e.TradeDate, e.SeoTitle })
+                    .HasName("UserAmountSummaryIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");

+ 255 - 0
Service/Main1/ExportExcelsService.cs

@@ -0,0 +1,255 @@
+/*
+ * excel导出数据
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using MySystem.Models.Main1;
+using Library;
+using LitJson;
+
+namespace MySystem.Service.Main1
+{
+    public class ExportExcelsService
+    {
+        static string _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+
+        /// <summary>
+        /// 查询列表(适合多表关联查询)
+        /// </summary>
+        /// <param name="relationData">关联表</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="count">总数(输出)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public static List<Dictionary<string, object>> List(List<RelationData> relationData, string condition, out int count, int page = 1, int limit = 30, string orderBy = "sort desc,id desc")
+        {
+            List<string> fields = new List<string>(); //要显示的列,不设置则返回全部字段
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).IndexData("ExportExcels", relationData, orderBy, page, limit, condition, fields);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            count = int.Parse(obj["count"].ToString());
+            return diclist;
+        }
+        public static List<Dictionary<string, object>> List(List<RelationData> relationData, string condition, int page = 1, int limit = 30, string orderBy = "sort desc,id desc")
+        {
+            List<string> fields = new List<string>(); //要显示的列,不设置则返回全部字段
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).IndexData("ExportExcels", relationData, orderBy, page, limit, condition, fields);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询列表(单表)
+        /// </summary>
+        /// <param name="fieldList">返回的字段</param>
+        /// <param name="condition">查询条件</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <param name="orderBy">排序</param>
+        /// <returns></returns>
+        public static List<Dictionary<string, object>> List(string fieldList, string condition, int page = 1, int limit = 30, string orderBy = "sort desc,id desc")
+        {
+            List<string> fields = fieldList.Split(',').ToList(); //要显示的列
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).IndexData("ExportExcels", new List<RelationData>(), orderBy, page, limit, condition, fields);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public static ExportExcels Query(int Id)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("*", "ExportExcels", Id);
+            if(obj.Keys.Count > 0)
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<ExportExcels>(Newtonsoft.Json.JsonConvert.SerializeObject(obj));
+            }
+            return new ExportExcels();
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public static ExportExcels Query(string condition)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("*", "ExportExcels", condition);
+            if(obj.Keys.Count > 0)
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<ExportExcels>(Newtonsoft.Json.JsonConvert.SerializeObject(obj));
+            }
+            return new ExportExcels();
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="fields">返回的字段</param>
+        /// <returns></returns>
+        public static Dictionary<string, object> Query(string condition, string fields)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query(fields, "ExportExcels", condition);
+            return obj;
+        }
+        
+        public static decimal Sum(string condition, string field)
+        {
+            decimal amount = 0;
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field + "", "ExportExcels", condition);
+            if(obj.Keys.Count > 0)
+            {
+                amount = decimal.Parse(obj[field].ToString());
+            }
+            return amount;
+        }
+
+        /// <summary>
+        /// 查询记录数
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public static int Count(string condition = "", string field = "Id")
+        {
+            int result = 0;
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("count(" + field + ") " + field + "", "ExportExcels", condition);
+            if(obj.Keys.Count > 0)
+            {
+                result = int.Parse(function.CheckInt(obj[field].ToString()));
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 查询是否存在
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public static bool Exist(string condition)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("1", "ExportExcels", condition);
+            if(obj.Keys.Count > 0)
+            {
+                return true;
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public static AppResultJson Add(Dictionary<string, object> fields, bool check = true)
+        {
+            if(check)
+            {
+                if (string.IsNullOrEmpty(fields["FileName"].ToString()))
+{
+    return new AppResultJson() { Status = "-1", Info = "请填写文件名" };
+}
+if (string.IsNullOrEmpty(fields["FileUrl"].ToString()))
+{
+    return new AppResultJson() { Status = "-1", Info = "请填写文件路径" };
+}
+
+            }
+            int Id = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Add("ExportExcels", fields, 0);
+            return new AppResultJson(){ Status = "1", Data = Id };
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public static AppResultJson Edit(Dictionary<string, object> fields, int Id, bool check = true)
+        {
+            if(check)
+            {
+                if (string.IsNullOrEmpty(fields["FileName"].ToString()))
+{
+    return new AppResultJson() { Status = "-1", Info = "请填写文件名" };
+}
+if (string.IsNullOrEmpty(fields["FileUrl"].ToString()))
+{
+    return new AppResultJson() { Status = "-1", Info = "请填写文件路径" };
+}
+
+            }
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Edit("ExportExcels", fields, Id);
+            return new AppResultJson(){ Status = "1", Data = Id };
+        }
+
+        /// <summary>
+        /// 逻辑删除
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public static void Remove(int Id)
+        {
+            Dictionary<string, object> fields = new Dictionary<string, object>();
+            fields.Add("Status", -1);
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Edit("ExportExcels", fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public static void Delete(int Id)
+        {
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Delete("ExportExcels", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public static void Sort(int Id, int Sort)
+        {
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Sort("ExportExcels", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public static void Import(string ExcelData)
+        {
+            // WebCMSEntities db = new WebCMSEntities();
+            // JsonData list = JsonMapper.ToObject(ExcelData);
+            // for (int i = 1; i < list.Count;i++ )
+            // {
+            //     JsonData dr = list[i];
+                
+            //     db.ExportExcels.Add(new ExportExcels()
+            //     {
+            //         CreateDate = DateTime.Now,
+            //         UpdateDate = DateTime.Now,
+                    
+            //     });
+            //     db.SaveChanges();
+            // }
+            // db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        // public static void ExportExcel(List<RelationData> relationData, string condition)
+        // {
+            
+        // }
+    }
+}