Преглед изворни кода

修复分仓向总仓申请机具的bug

lichunlei пре 4 година
родитељ
комит
b4526eb31c

+ 21 - 8
AppStart/RelationClass.cs

@@ -475,15 +475,28 @@ namespace MySystem
 
         public static string GetPosMachinesTwoInfo(int key)
         {
-        using (WebCMSEntities db = new WebCMSEntities())
-        {
-        PosMachinesTwo item = db.PosMachinesTwo.FirstOrDefault(m => m.Id == key);
-        if (item != null)
-        {
-        return item.PosSn;
-        }
+            using (WebCMSEntities db = new WebCMSEntities())
+            {
+                PosMachinesTwo item = db.PosMachinesTwo.FirstOrDefault(m => m.Id == key);
+                if (item != null)
+                {
+                    return item.PosSn;
+                }
+            }
+            return "";
         }
-        return "";
+
+        public static string GetStoreMachineApplyInfo(int key)
+        {
+            using (WebCMSEntities db = new WebCMSEntities())
+            {
+                StoreMachineApply item = db.StoreMachineApply.FirstOrDefault(m => m.Id == key);
+                if (item != null)
+                {
+                    return item.ApplyNo;
+                }
+            }
+            return "";
         }
 
     }

+ 105 - 104
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -25,6 +25,7 @@ namespace MySystem.Areas.Admin.Controllers
     {
         public StoreHouseAmountRecordController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
         {
+            OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         }
 
         #region 分仓机具额度记录列表
@@ -37,8 +38,8 @@ namespace MySystem.Areas.Admin.Controllers
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = right;
-            
-            
+
+
             return View();
         }
 
@@ -52,56 +53,56 @@ namespace MySystem.Areas.Admin.Controllers
         /// <returns></returns>
         public JsonResult IndexData(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string AmountTypeSelect, string OperateTypeSelect, int page = 1, int limit = 30)
         {
-            
+
             Dictionary<string, string> Fields = new Dictionary<string, string>();
-            
+
             Fields.Add("CreateDate", "3"); //时间
 
 
             string condition = " and Status>-1";
             //创客真实姓名
-if (!string.IsNullOrEmpty(UserIdRealName))
-{
-condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
-}
-//创客创客编号
-if (!string.IsNullOrEmpty(UserIdMakerCode))
-{
-condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
-}
-//额度类别
-if (!string.IsNullOrEmpty(AmountTypeSelect))
-{
-condition += " and AmountType=" + AmountTypeSelect;
-}
-//操作类别
-if (!string.IsNullOrEmpty(OperateTypeSelect))
-{
-condition += " and OperateType=" + OperateTypeSelect;
-}
+            if (!string.IsNullOrEmpty(UserIdRealName))
+            {
+                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+            }
+            //创客创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            //额度类别
+            if (!string.IsNullOrEmpty(AmountTypeSelect))
+            {
+                condition += " and AmountType=" + AmountTypeSelect;
+            }
+            //操作类别
+            if (!string.IsNullOrEmpty(OperateTypeSelect))
+            {
+                condition += " and OperateType=" + OperateTypeSelect;
+            }
 
 
-            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
                 //创客
-int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
-Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
-dic["UserIdRealName"] = userid_Users.RealName;
-dic["UserIdMakerCode"] = userid_Users.MakerCode;
-dic.Remove("UserId");
-//申请单
-dic["ApplyId"] = RelationClass.GetStoreMachineApplyInfo(int.Parse(dic["ApplyId"].ToString()));
-//额度类别
-int AmountType = int.Parse(dic["AmountType"].ToString());
-if(AmountType == 0) dic["AmountType"] = "固定额度";
-if(AmountType == 1) dic["AmountType"] = "临时额度";
-//操作类别
-int OperateType = int.Parse(dic["OperateType"].ToString());
-if(OperateType == 1) dic["OperateType"] = "增加";
-if(OperateType == 2) dic["OperateType"] = "减少";
-if(OperateType == 0) dic["OperateType"] = "";
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdRealName"] = userid_Users.RealName;
+                dic["UserIdMakerCode"] = userid_Users.MakerCode;
+                dic.Remove("UserId");
+                //申请单
+                dic["ApplyId"] = RelationClass.GetStoreMachineApplyInfo(int.Parse(dic["ApplyId"].ToString()));
+                //额度类别
+                int AmountType = int.Parse(dic["AmountType"].ToString());
+                if (AmountType == 0) dic["AmountType"] = "固定额度";
+                if (AmountType == 1) dic["AmountType"] = "临时额度";
+                //操作类别
+                int OperateType = int.Parse(dic["OperateType"].ToString());
+                if (OperateType == 1) dic["OperateType"] = "增加";
+                if (OperateType == 2) dic["OperateType"] = "减少";
+                if (OperateType == 0) dic["OperateType"] = "";
 
             }
             return Json(obj);
@@ -119,7 +120,7 @@ if(OperateType == 0) dic["OperateType"] = "";
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = right;
-            
+
 
             return View();
         }
@@ -136,16 +137,16 @@ if(OperateType == 0) dic["OperateType"] = "";
         public string Add(StoreHouseAmountRecord data)
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
-            
+
             Fields.Add("OperateType", data.OperateType); //操作类别
 
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoKeyword", data.SeoKeyword);
             Fields.Add("SeoDescription", data.SeoDescription);
-            int Id = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Add("StoreHouseAmountRecord", Fields, 0);
+            int Id = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Add("StoreHouseAmountRecord", Fields, 0);
             AddSysLog(data.Id.ToString(), "StoreHouseAmountRecord", "add");
             db.SaveChanges();
-            
+
             return "success";
         }
 
@@ -161,7 +162,7 @@ if(OperateType == 0) dic["OperateType"] = "";
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = right;
-            
+
 
             StoreHouseAmountRecord editData = db.StoreHouseAmountRecord.FirstOrDefault(m => m.Id == Id) ?? new StoreHouseAmountRecord();
             ViewBag.data = editData;
@@ -180,16 +181,16 @@ if(OperateType == 0) dic["OperateType"] = "";
         public string Edit(StoreHouseAmountRecord data)
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
-            
+
             Fields.Add("OperateType", data.OperateType); //操作类别
 
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoKeyword", data.SeoKeyword);
             Fields.Add("SeoDescription", data.SeoDescription);
-            new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreHouseAmountRecord", Fields, data.Id);
-            AddSysLog(data.Id.ToString(),"StoreHouseAmountRecord","update");
+            new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, data.Id);
+            AddSysLog(data.Id.ToString(), "StoreHouseAmountRecord", "update");
             db.SaveChanges();
-            
+
             return "success";
         }
 
@@ -204,16 +205,16 @@ if(OperateType == 0) dic["OperateType"] = "";
         public string Delete(string Id)
         {
             string[] idlist = Id.Split(new char[] { ',' });
-            AddSysLog(Id,"StoreHouseAmountRecord","del");
+            AddSysLog(Id, "StoreHouseAmountRecord", "del");
             foreach (string subid in idlist)
             {
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", -1);
-                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreHouseAmountRecord", Fields, id);
+                new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
             }
             db.SaveChanges();
-            
+
             return "success";
         }
 
@@ -228,13 +229,13 @@ if(OperateType == 0) dic["OperateType"] = "";
         public string Open(string Id)
         {
             string[] idlist = Id.Split(new char[] { ',' });
-            AddSysLog(Id,"StoreHouseAmountRecord","open");
+            AddSysLog(Id, "StoreHouseAmountRecord", "open");
             foreach (string subid in idlist)
             {
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", 1);
-                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreHouseAmountRecord", Fields, id);
+                new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
             }
             db.SaveChanges();
             return "success";
@@ -251,13 +252,13 @@ if(OperateType == 0) dic["OperateType"] = "";
         public string Close(string Id)
         {
             string[] idlist = Id.Split(new char[] { ',' });
-            AddSysLog(Id,"StoreHouseAmountRecord","close");
+            AddSysLog(Id, "StoreHouseAmountRecord", "close");
             foreach (string subid in idlist)
             {
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", 0);
-                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreHouseAmountRecord", Fields, id);
+                new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
             }
             db.SaveChanges();
             return "success";
@@ -272,8 +273,8 @@ if(OperateType == 0) dic["OperateType"] = "";
         /// <param name="Id"></param>
         public string Sort(int Id, int Sort)
         {
-            new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Sort("StoreHouseAmountRecord", Sort, Id);
-            
+            new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Sort("StoreHouseAmountRecord", Sort, Id);
+
             AddSysLog(Id.ToString(), "StoreHouseAmountRecord", "sort");
             return "success";
         }
@@ -288,15 +289,15 @@ if(OperateType == 0) dic["OperateType"] = "";
         {
             ExcelData = HttpUtility.UrlDecode(ExcelData);
             JsonData list = JsonMapper.ToObject(ExcelData);
-            for (int i = 1; i < list.Count;i++ )
+            for (int i = 1; i < list.Count; i++)
             {
                 JsonData dr = list[i];
-                
+
                 db.StoreHouseAmountRecord.Add(new StoreHouseAmountRecord()
                 {
                     CreateDate = DateTime.Now,
                     UpdateDate = DateTime.Now,
-                    
+
                 });
                 db.SaveChanges();
             }
@@ -319,48 +320,48 @@ if(OperateType == 0) dic["OperateType"] = "";
 
             string condition = " and Status>-1";
             //创客真实姓名
-if (!string.IsNullOrEmpty(UserIdRealName))
-{
-condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
-}
-//创客创客编号
-if (!string.IsNullOrEmpty(UserIdMakerCode))
-{
-condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
-}
-//额度类别
-if (!string.IsNullOrEmpty(AmountTypeSelect))
-{
-condition += " and AmountType=" + AmountTypeSelect;
-}
-//操作类别
-if (!string.IsNullOrEmpty(OperateTypeSelect))
-{
-condition += " and OperateType=" + OperateTypeSelect;
-}
+            if (!string.IsNullOrEmpty(UserIdRealName))
+            {
+                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+            }
+            //创客创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            //额度类别
+            if (!string.IsNullOrEmpty(AmountTypeSelect))
+            {
+                condition += " and AmountType=" + AmountTypeSelect;
+            }
+            //操作类别
+            if (!string.IsNullOrEmpty(OperateTypeSelect))
+            {
+                condition += " and OperateType=" + OperateTypeSelect;
+            }
 
 
-            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "UserId,ApplyId,UseAmount,BeforeAmount,AfterAmount,AmountType,OperateType", false);
+            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "UserId,ApplyId,UseAmount,BeforeAmount,AfterAmount,AmountType,OperateType", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
                 //创客
-int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
-Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
-dic["UserIdRealName"] = userid_Users.RealName;
-dic["UserIdMakerCode"] = userid_Users.MakerCode;
-dic.Remove("UserId");
-//申请单
-dic["ApplyId"] = RelationClass.GetStoreMachineApplyInfo(int.Parse(dic["ApplyId"].ToString()));
-//额度类别
-int AmountType = int.Parse(dic["AmountType"].ToString());
-if(AmountType == 0) dic["AmountType"] = "固定额度";
-if(AmountType == 1) dic["AmountType"] = "临时额度";
-//操作类别
-int OperateType = int.Parse(dic["OperateType"].ToString());
-if(OperateType == 1) dic["OperateType"] = "增加";
-if(OperateType == 2) dic["OperateType"] = "减少";
-if(OperateType == 0) dic["OperateType"] = "";
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdRealName"] = userid_Users.RealName;
+                dic["UserIdMakerCode"] = userid_Users.MakerCode;
+                dic.Remove("UserId");
+                //申请单
+                dic["ApplyId"] = RelationClass.GetStoreMachineApplyInfo(int.Parse(dic["ApplyId"].ToString()));
+                //额度类别
+                int AmountType = int.Parse(dic["AmountType"].ToString());
+                if (AmountType == 0) dic["AmountType"] = "固定额度";
+                if (AmountType == 1) dic["AmountType"] = "临时额度";
+                //操作类别
+                int OperateType = int.Parse(dic["OperateType"].ToString());
+                if (OperateType == 1) dic["OperateType"] = "增加";
+                if (OperateType == 2) dic["OperateType"] = "减少";
+                if (OperateType == 0) dic["OperateType"] = "";
 
             }
 
@@ -370,13 +371,13 @@ if(OperateType == 0) dic["OperateType"] = "";
             result.Add("Obj", diclist);
             Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
             ReturnFields.Add("UserIdRealName", "创客真实姓名");
-ReturnFields.Add("UserIdMakerCode", "创客创客编号");
-ReturnFields.Add("ApplyId", "申请单");
-ReturnFields.Add("UseAmount", "使用额度");
-ReturnFields.Add("BeforeAmount", "使用前剩余额度");
-ReturnFields.Add("AfterAmount", "使用后剩余额度");
-ReturnFields.Add("AmountType", "额度类别");
-ReturnFields.Add("OperateType", "操作类别");
+            ReturnFields.Add("UserIdMakerCode", "创客创客编号");
+            ReturnFields.Add("ApplyId", "申请单");
+            ReturnFields.Add("UseAmount", "使用额度");
+            ReturnFields.Add("BeforeAmount", "使用前剩余额度");
+            ReturnFields.Add("AfterAmount", "使用后剩余额度");
+            ReturnFields.Add("AmountType", "额度类别");
+            ReturnFields.Add("OperateType", "操作类别");
 
             result.Add("Fields", ReturnFields);
             AddSysLog("0", "StoreHouseAmountRecord", "ExportExcel");

+ 100 - 99
Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

@@ -25,6 +25,7 @@ namespace MySystem.Areas.Admin.Controllers
     {
         public StoreMachineApplyController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
         {
+            OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         }
 
         #region 分仓机具申请记录列表
@@ -37,8 +38,8 @@ namespace MySystem.Areas.Admin.Controllers
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = right;
-            
-            
+
+
             return View();
         }
 
@@ -52,45 +53,45 @@ namespace MySystem.Areas.Admin.Controllers
         /// <returns></returns>
         public JsonResult IndexData(StoreMachineApply data, string BrandIdSelect, string UserIdRealName, string UserIdMakerCode, int page = 1, int limit = 30)
         {
-            
+
             Dictionary<string, string> Fields = new Dictionary<string, string>();
-            
+
             Fields.Add("CreateDate", "3"); //时间
-Fields.Add("ApplyNo", "1"); //申请单号
-Fields.Add("SendMode", "1"); //发货方式
+            Fields.Add("ApplyNo", "1"); //申请单号
+            Fields.Add("SendMode", "1"); //发货方式
 
 
             string condition = " and Status>-1";
             //品牌
-if (!string.IsNullOrEmpty(BrandIdSelect))
-{
-condition += " and BrandId=" + BrandIdSelect;
-}
-//创客真实姓名
-if (!string.IsNullOrEmpty(UserIdRealName))
-{
-condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
-}
-//创客创客编号
-if (!string.IsNullOrEmpty(UserIdMakerCode))
-{
-condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
-}
+            if (!string.IsNullOrEmpty(BrandIdSelect))
+            {
+                condition += " and BrandId=" + BrandIdSelect;
+            }
+            //创客真实姓名
+            if (!string.IsNullOrEmpty(UserIdRealName))
+            {
+                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+            }
+            //创客创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
 
 
-            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("StoreMachineApply", Fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreMachineApply", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
                 //品牌
-dic["BrandId"] = RelationClass.GetKqProductsInfo(int.Parse(dic["BrandId"].ToString()));
-dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
-//创客
-int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
-Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
-dic["UserIdRealName"] = userid_Users.RealName;
-dic["UserIdMakerCode"] = userid_Users.MakerCode;
-dic.Remove("UserId");
+                dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
+                dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
+                //创客
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdRealName"] = userid_Users.RealName;
+                dic["UserIdMakerCode"] = userid_Users.MakerCode;
+                dic.Remove("UserId");
 
             }
             return Json(obj);
@@ -108,7 +109,7 @@ dic.Remove("UserId");
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = right;
-            
+
 
             return View();
         }
@@ -125,24 +126,24 @@ dic.Remove("UserId");
         public string Add(StoreMachineApply data)
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
-            
+
             Fields.Add("BrandId", data.BrandId); //品牌
-Fields.Add("ApplyNo", data.ApplyNo); //申请单号
-Fields.Add("ApplyNum", data.ApplyNum); //申请台数
-Fields.Add("SendNum", data.SendNum); //发货台数
-Fields.Add("UseAmount", data.UseAmount); //使用额度
-Fields.Add("SendMode", data.SendMode); //发货方式
-Fields.Add("ErpCode", data.ErpCode); //快递单号
-Fields.Add("SendSn", data.SendSn); //发货SN数据
-Fields.Add("UserId", data.UserId); //创客
+            Fields.Add("ApplyNo", data.ApplyNo); //申请单号
+            Fields.Add("ApplyNum", data.ApplyNum); //申请台数
+            Fields.Add("SendNum", data.SendNum); //发货台数
+            Fields.Add("UseAmount", data.UseAmount); //使用额度
+            Fields.Add("SendMode", data.SendMode); //发货方式
+            Fields.Add("ErpCode", data.ErpCode); //快递单号
+            Fields.Add("SendSn", data.SendSn); //发货SN数据
+            Fields.Add("UserId", data.UserId); //创客
 
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoKeyword", data.SeoKeyword);
             Fields.Add("SeoDescription", data.SeoDescription);
-            int Id = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Add("StoreMachineApply", Fields, 0);
+            int Id = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Add("StoreMachineApply", Fields, 0);
             AddSysLog(data.Id.ToString(), "StoreMachineApply", "add");
             db.SaveChanges();
-            
+
             return "success";
         }
 
@@ -158,7 +159,7 @@ Fields.Add("UserId", data.UserId); //创客
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = right;
-            
+
 
             StoreMachineApply editData = db.StoreMachineApply.FirstOrDefault(m => m.Id == Id) ?? new StoreMachineApply();
             ViewBag.data = editData;
@@ -177,24 +178,24 @@ Fields.Add("UserId", data.UserId); //创客
         public string Edit(StoreMachineApply data)
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
-            
+
             Fields.Add("BrandId", data.BrandId); //品牌
-Fields.Add("ApplyNo", data.ApplyNo); //申请单号
-Fields.Add("ApplyNum", data.ApplyNum); //申请台数
-Fields.Add("SendNum", data.SendNum); //发货台数
-Fields.Add("UseAmount", data.UseAmount); //使用额度
-Fields.Add("SendMode", data.SendMode); //发货方式
-Fields.Add("ErpCode", data.ErpCode); //快递单号
-Fields.Add("SendSn", data.SendSn); //发货SN数据
-Fields.Add("UserId", data.UserId); //创客
+            Fields.Add("ApplyNo", data.ApplyNo); //申请单号
+            Fields.Add("ApplyNum", data.ApplyNum); //申请台数
+            Fields.Add("SendNum", data.SendNum); //发货台数
+            Fields.Add("UseAmount", data.UseAmount); //使用额度
+            Fields.Add("SendMode", data.SendMode); //发货方式
+            Fields.Add("ErpCode", data.ErpCode); //快递单号
+            Fields.Add("SendSn", data.SendSn); //发货SN数据
+            Fields.Add("UserId", data.UserId); //创客
 
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoKeyword", data.SeoKeyword);
             Fields.Add("SeoDescription", data.SeoDescription);
-            new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreMachineApply", Fields, data.Id);
-            AddSysLog(data.Id.ToString(),"StoreMachineApply","update");
+            new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreMachineApply", Fields, data.Id);
+            AddSysLog(data.Id.ToString(), "StoreMachineApply", "update");
             db.SaveChanges();
-            
+
             return "success";
         }
 
@@ -209,16 +210,16 @@ Fields.Add("UserId", data.UserId); //创客
         public string Delete(string Id)
         {
             string[] idlist = Id.Split(new char[] { ',' });
-            AddSysLog(Id,"StoreMachineApply","del");
+            AddSysLog(Id, "StoreMachineApply", "del");
             foreach (string subid in idlist)
             {
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", -1);
-                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreMachineApply", Fields, id);
+                new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreMachineApply", Fields, id);
             }
             db.SaveChanges();
-            
+
             return "success";
         }
 
@@ -233,13 +234,13 @@ Fields.Add("UserId", data.UserId); //创客
         public string Open(string Id)
         {
             string[] idlist = Id.Split(new char[] { ',' });
-            AddSysLog(Id,"StoreMachineApply","open");
+            AddSysLog(Id, "StoreMachineApply", "open");
             foreach (string subid in idlist)
             {
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", 1);
-                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreMachineApply", Fields, id);
+                new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreMachineApply", Fields, id);
             }
             db.SaveChanges();
             return "success";
@@ -256,13 +257,13 @@ Fields.Add("UserId", data.UserId); //创客
         public string Close(string Id)
         {
             string[] idlist = Id.Split(new char[] { ',' });
-            AddSysLog(Id,"StoreMachineApply","close");
+            AddSysLog(Id, "StoreMachineApply", "close");
             foreach (string subid in idlist)
             {
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", 0);
-                new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("StoreMachineApply", Fields, id);
+                new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreMachineApply", Fields, id);
             }
             db.SaveChanges();
             return "success";
@@ -277,8 +278,8 @@ Fields.Add("UserId", data.UserId); //创客
         /// <param name="Id"></param>
         public string Sort(int Id, int Sort)
         {
-            new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).Sort("StoreMachineApply", Sort, Id);
-            
+            new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Sort("StoreMachineApply", Sort, Id);
+
             AddSysLog(Id.ToString(), "StoreMachineApply", "sort");
             return "success";
         }
@@ -293,15 +294,15 @@ Fields.Add("UserId", data.UserId); //创客
         {
             ExcelData = HttpUtility.UrlDecode(ExcelData);
             JsonData list = JsonMapper.ToObject(ExcelData);
-            for (int i = 1; i < list.Count;i++ )
+            for (int i = 1; i < list.Count; i++)
             {
                 JsonData dr = list[i];
-                
+
                 db.StoreMachineApply.Add(new StoreMachineApply()
                 {
                     CreateDate = DateTime.Now,
                     UpdateDate = DateTime.Now,
-                    
+
                 });
                 db.SaveChanges();
             }
@@ -320,41 +321,41 @@ Fields.Add("UserId", data.UserId); //创客
         {
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("CreateDate", "3"); //时间
-Fields.Add("ApplyNo", "1"); //申请单号
-Fields.Add("SendMode", "1"); //发货方式
+            Fields.Add("ApplyNo", "1"); //申请单号
+            Fields.Add("SendMode", "1"); //发货方式
 
 
             string condition = " and Status>-1";
             //品牌
-if (!string.IsNullOrEmpty(BrandIdSelect))
-{
-condition += " and BrandId=" + BrandIdSelect;
-}
-//创客真实姓名
-if (!string.IsNullOrEmpty(UserIdRealName))
-{
-condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
-}
-//创客创客编号
-if (!string.IsNullOrEmpty(UserIdMakerCode))
-{
-condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
-}
+            if (!string.IsNullOrEmpty(BrandIdSelect))
+            {
+                condition += " and BrandId=" + BrandIdSelect;
+            }
+            //创客真实姓名
+            if (!string.IsNullOrEmpty(UserIdRealName))
+            {
+                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+            }
+            //创客创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
 
 
-            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("StoreMachineApply", Fields, "Id desc", "0", 1, 20000, condition, "BrandId,ApplyNo,ApplyNum,SendNum,UseAmount,SendMode,ErpCode,UserId", false);
+            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreMachineApply", Fields, "Id desc", "0", 1, 20000, condition, "BrandId,ApplyNo,ApplyNum,SendNum,UseAmount,SendMode,ErpCode,UserId", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
                 //品牌
-dic["BrandId"] = RelationClass.GetKqProductsInfo(int.Parse(dic["BrandId"].ToString()));
-dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
-//创客
-int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
-Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
-dic["UserIdRealName"] = userid_Users.RealName;
-dic["UserIdMakerCode"] = userid_Users.MakerCode;
-dic.Remove("UserId");
+                dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
+                dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
+                //创客
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdRealName"] = userid_Users.RealName;
+                dic["UserIdMakerCode"] = userid_Users.MakerCode;
+                dic.Remove("UserId");
 
             }
 
@@ -364,14 +365,14 @@ dic.Remove("UserId");
             result.Add("Obj", diclist);
             Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
             ReturnFields.Add("BrandId", "品牌");
-ReturnFields.Add("ApplyNo", "申请单号");
-ReturnFields.Add("ApplyNum", "申请台数");
-ReturnFields.Add("SendNum", "发货台数");
-ReturnFields.Add("UseAmount", "使用额度");
-ReturnFields.Add("SendMode", "发货方式");
-ReturnFields.Add("ErpCode", "快递单号");
-ReturnFields.Add("UserIdRealName", "创客真实姓名");
-ReturnFields.Add("UserIdMakerCode", "创客创客编号");
+            ReturnFields.Add("ApplyNo", "申请单号");
+            ReturnFields.Add("ApplyNum", "申请台数");
+            ReturnFields.Add("SendNum", "发货台数");
+            ReturnFields.Add("UseAmount", "使用额度");
+            ReturnFields.Add("SendMode", "发货方式");
+            ReturnFields.Add("ErpCode", "快递单号");
+            ReturnFields.Add("UserIdRealName", "创客真实姓名");
+            ReturnFields.Add("UserIdMakerCode", "创客创客编号");
 
             result.Add("Fields", ReturnFields);
             AddSysLog("0", "StoreMachineApply", "ExportExcel");