Просмотр исходного кода

Merge branch 'feature-dgy-市场活动功能调整' into feature-dgy-后台测试

DuGuYang 3 лет назад
Родитель
Сommit
baaef60422

+ 14 - 18
Areas/Admin/Controllers/BsServer/AdvertismentController.cs

@@ -32,11 +32,12 @@ namespace MySystem.Areas.Admin.Controllers
         /// 根据条件查询广告位列表
         /// 根据条件查询广告位列表
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
-        public IActionResult Index(Advertisment data, string right)
+        public IActionResult Index(Advertisment data, string right, string CurColId)
         {
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = right;
             ViewBag.right = right;
             ViewBag.SysUserName = SysUserName;
             ViewBag.SysUserName = SysUserName;
+            ViewBag.CurColId = CurColId;
 
 
             string Condition = "";
             string Condition = "";
             Condition += "Title:\"" + data.Title + "\",";
             Condition += "Title:\"" + data.Title + "\",";
@@ -58,13 +59,15 @@ namespace MySystem.Areas.Admin.Controllers
         /// 广告位列表
         /// 广告位列表
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
-        public JsonResult IndexData(Advertisment data, int page = 1, int limit = 30)
+        public JsonResult IndexData(Advertisment data, string CurColId, int page = 1, int limit = 30)
         {
         {
-            Dictionary<string, string> ColDic = new DictionaryClass().getColDic("003");
+            Dictionary<string, string> ColDic = new DictionaryClass().getColDic(CurColId);
 
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("Title", "2"); //标题
             Fields.Add("Title", "2"); //标题
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("Advertisment", Fields, "Id desc", "False", page, limit);
+            string condition = " and ColId like '" + CurColId + "%'";
+            // Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("Advertisment", Fields, "Id desc", "False", page, limit);
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("Advertisment", Fields, "Id desc", "False", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             foreach (Dictionary<string, object> dic in diclist)
             {
             {
@@ -81,11 +84,12 @@ namespace MySystem.Areas.Admin.Controllers
         /// 增加或修改广告位信息
         /// 增加或修改广告位信息
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
-        public IActionResult Add()
+        public IActionResult Add(string right, string CurColId)
         {
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = _accessor.HttpContext.Request.Query["right"];
             ViewBag.right = _accessor.HttpContext.Request.Query["right"];
             ViewBag.SysUserName = SysUserName;
             ViewBag.SysUserName = SysUserName;
+            ViewBag.CurColId = CurColId;
 
 
             return View();
             return View();
         }
         }
@@ -99,7 +103,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost]
         [HttpPost]
-        public string Add(Advertisment data)
+        public string Add(Advertisment data, string CurColId = "")
         {
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
             Dictionary<string, object> Fields = new Dictionary<string, object>();
             Fields.Add("Title", data.Title); //标题
             Fields.Add("Title", data.Title); //标题
@@ -114,8 +118,6 @@ namespace MySystem.Areas.Admin.Controllers
             AddSysLog(data.Id.ToString(), "Advertisment", "add");
             AddSysLog(data.Id.ToString(), "Advertisment", "add");
             bsdb.SaveChanges();
             bsdb.SaveChanges();
 
 
-            SetRedis(data.ColId, Id);
-
             return "success";
             return "success";
         }
         }
 
 
@@ -127,11 +129,12 @@ namespace MySystem.Areas.Admin.Controllers
         /// 增加或修改广告位信息
         /// 增加或修改广告位信息
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
-        public IActionResult Edit(int Id = 0)
+        public IActionResult Edit(string right, string CurColId, int Id = 0)
         {
         {
             ViewBag.RightInfo = RightInfo;
             ViewBag.RightInfo = RightInfo;
             ViewBag.right = _accessor.HttpContext.Request.Query["right"];
             ViewBag.right = _accessor.HttpContext.Request.Query["right"];
             ViewBag.SysUserName = SysUserName;
             ViewBag.SysUserName = SysUserName;
+            ViewBag.CurColId = CurColId;
 
 
             Advertisment editData = bsdb.Advertisment.FirstOrDefault(m => m.Id == Id) ?? new Advertisment();
             Advertisment editData = bsdb.Advertisment.FirstOrDefault(m => m.Id == Id) ?? new Advertisment();
             ViewBag.data = editData;
             ViewBag.data = editData;
@@ -147,7 +150,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost]
         [HttpPost]
-        public string Edit(Advertisment data)
+        public string Edit(Advertisment data, string CurColId = "")
         {
         {
             Dictionary<string, object> Fields = new Dictionary<string, object>();
             Dictionary<string, object> Fields = new Dictionary<string, object>();
             Fields.Add("Title", data.Title); //标题
             Fields.Add("Title", data.Title); //标题
@@ -161,8 +164,6 @@ namespace MySystem.Areas.Admin.Controllers
             AddSysLog(data.Id.ToString(), "Advertisment", "update");
             AddSysLog(data.Id.ToString(), "Advertisment", "update");
             bsdb.SaveChanges();
             bsdb.SaveChanges();
 
 
-            SetRedis(data.ColId, data.Id);
-
             return "success";
             return "success";
         }
         }
 
 
@@ -183,12 +184,11 @@ namespace MySystem.Areas.Admin.Controllers
                 int id = int.Parse(subid);
                 int id = int.Parse(subid);
                 string ColId = "";
                 string ColId = "";
                 Advertisment ad = bsdb.Advertisment.FirstOrDefault(m => m.Id == id);
                 Advertisment ad = bsdb.Advertisment.FirstOrDefault(m => m.Id == id);
-                if(ad != null)
+                if (ad != null)
                 {
                 {
                     ColId = ad.ColId;
                     ColId = ad.ColId;
                 }
                 }
                 new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Delete("Advertisment", id);
                 new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Delete("Advertisment", id);
-                SetRedis(ColId);
             }
             }
             bsdb.SaveChanges();
             bsdb.SaveChanges();
 
 
@@ -254,10 +254,6 @@ namespace MySystem.Areas.Admin.Controllers
 
 
             AddSysLog(Id.ToString(), "Advertisment", "sort");
             AddSysLog(Id.ToString(), "Advertisment", "sort");
             Advertisment ad = bsdb.Advertisment.FirstOrDefault(m => m.Id == Id);
             Advertisment ad = bsdb.Advertisment.FirstOrDefault(m => m.Id == Id);
-            if(ad != null)
-            {
-                SetRedis(ad.ColId);
-            }
             return "success";
             return "success";
         }
         }
         #endregion
         #endregion

+ 43 - 27
Areas/Admin/Controllers/CashServer/WithdrawRecordController.cs

@@ -83,17 +83,28 @@ namespace MySystem.Areas.Admin.Controllers
             {
             {
                 //订单状态
                 //订单状态
                 int TradeStatus = int.Parse(dic["TradeStatus"].ToString());
                 int TradeStatus = int.Parse(dic["TradeStatus"].ToString());
-                if (TradeStatus == 0) dic["TradeStatusName"] = "初始化";
-                if (TradeStatus == 1) dic["TradeStatusName"] = "未审核,待打款";
-                if (TradeStatus == 2) dic["TradeStatusName"] = "审核通过,待打款";
-                if (TradeStatus == 3) dic["TradeStatusName"] = "审核不通过,已解冻";
-                if (TradeStatus == 4) dic["TradeStatusName"] = "冻结失败(预留)";
-                if (TradeStatus == 5) dic["TradeStatusName"] = "代付成功";
-                if (TradeStatus == 6) dic["TradeStatusName"] = "代付失败,待核实";
-                if (TradeStatus == 7) dic["TradeStatusName"] = "代付失败,已解冻";
-                if (TradeStatus == 8) dic["TradeStatusName"] = "代付处理中";
-                //代付渠道
-                dic["CashChannel"] = "云汇算";
+                string CashChannel = dic["CashChannel"].ToString();
+                if(CashChannel == "云汇算")
+                {
+                    if (TradeStatus == 0) dic["TradeStatusName"] = "初始化";
+                    if (TradeStatus == 1) dic["TradeStatusName"] = "未审核,待打款";
+                    if (TradeStatus == 2) dic["TradeStatusName"] = "审核通过,待打款";
+                    if (TradeStatus == 3) dic["TradeStatusName"] = "审核不通过,已解冻";
+                    if (TradeStatus == 4) dic["TradeStatusName"] = "冻结失败(预留)";
+                    if (TradeStatus == 5) dic["TradeStatusName"] = "代付成功";
+                    if (TradeStatus == 6) dic["TradeStatusName"] = "代付失败,待核实";
+                    if (TradeStatus == 7) dic["TradeStatusName"] = "代付失败,已解冻";
+                    if (TradeStatus == 8) dic["TradeStatusName"] = "代付处理中";
+                }
+                else if(CashChannel == "金控")
+                {
+                    if (TradeStatus == 0) dic["TradeStatusName"] = "进行中";
+                    if (TradeStatus == 1) dic["TradeStatusName"] = "处理中";
+                    if (TradeStatus == 2) dic["TradeStatusName"] = "成功";
+                    if (TradeStatus == 3) dic["TradeStatusName"] = "失败";
+                    if (TradeStatus == 4) dic["TradeStatusName"] = "取消";
+                    if (TradeStatus == 10) dic["TradeStatusName"] = "可疑";
+                }
 
 
             }
             }
             return Json(obj);
             return Json(obj);
@@ -335,23 +346,28 @@ namespace MySystem.Areas.Admin.Controllers
             {
             {
                 //订单状态
                 //订单状态
                 int TradeStatus = int.Parse(dic["TradeStatus"].ToString());
                 int TradeStatus = int.Parse(dic["TradeStatus"].ToString());
-                if (TradeStatus == 0) dic["TradeStatus"] = "初始化";
-                if (TradeStatus == 1) dic["TradeStatus"] = "未审核,待打款";
-                if (TradeStatus == 2) dic["TradeStatus"] = "审核通过,待打款";
-                if (TradeStatus == 3) dic["TradeStatus"] = "审核不通过,已解冻";
-                if (TradeStatus == 4) dic["TradeStatus"] = "冻结失败(预留)";
-                if (TradeStatus == 5) dic["TradeStatus"] = "代付成功";
-                if (TradeStatus == 6) dic["TradeStatus"] = "代付失败,待核实";
-                if (TradeStatus == 7) dic["TradeStatus"] = "代付失败,已解冻";
-                if (TradeStatus == 8) dic["TradeStatus"] = "代付处理中";
-                //代付渠道
                 string CashChannel = dic["CashChannel"].ToString();
                 string CashChannel = dic["CashChannel"].ToString();
-                if (CashChannel == "CloudAcc") dic["CashChannel"] = "云账户";
-                if (CashChannel == "KuaiQian") dic["CashChannel"] = "快钱";
-                if (CashChannel == "CloudPay") dic["CashChannel"] = "云银付";
-                if (CashChannel == "CloudPayAF") dic["CashChannel"] = "安福灵新";
-                if (CashChannel == "JuHeBa") dic["CashChannel"] = "聚合吧云慧算";
-                if (CashChannel == "") dic["CashChannel"] = "";
+                if(CashChannel == "云汇算")
+                {
+                    if (TradeStatus == 0) dic["TradeStatus"] = "初始化";
+                    if (TradeStatus == 1) dic["TradeStatus"] = "未审核,待打款";
+                    if (TradeStatus == 2) dic["TradeStatus"] = "审核通过,待打款";
+                    if (TradeStatus == 3) dic["TradeStatus"] = "审核不通过,已解冻";
+                    if (TradeStatus == 4) dic["TradeStatus"] = "冻结失败(预留)";
+                    if (TradeStatus == 5) dic["TradeStatus"] = "代付成功";
+                    if (TradeStatus == 6) dic["TradeStatus"] = "代付失败,待核实";
+                    if (TradeStatus == 7) dic["TradeStatus"] = "代付失败,已解冻";
+                    if (TradeStatus == 8) dic["TradeStatus"] = "代付处理中";
+                }
+                else if(CashChannel == "金控")
+                {
+                    if (TradeStatus == 0) dic["TradeStatus"] = "进行中";
+                    if (TradeStatus == 1) dic["TradeStatus"] = "处理中";
+                    if (TradeStatus == 2) dic["TradeStatus"] = "成功";
+                    if (TradeStatus == 3) dic["TradeStatus"] = "失败";
+                    if (TradeStatus == 4) dic["TradeStatus"] = "取消";
+                    if (TradeStatus == 10) dic["TradeStatus"] = "可疑";
+                }
 
 
             }
             }
 
 

+ 230 - 198
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -1018,10 +1018,26 @@ namespace MySystem.Areas.Admin.Controllers
                     string StoreNo = itemJson.Contains("\"D\"") ? dr["D"].ToString() : "";
                     string StoreNo = itemJson.Contains("\"D\"") ? dr["D"].ToString() : "";
                     string No = itemJson.Contains("\"E\"") ? dr["E"].ToString() : "";
                     string No = itemJson.Contains("\"E\"") ? dr["E"].ToString() : "";
                     string Remark = itemJson.Contains("\"F\"") ? dr["F"].ToString() : "";
                     string Remark = itemJson.Contains("\"F\"") ? dr["F"].ToString() : "";
+                    if (string.IsNullOrEmpty(PosSn) || string.IsNullOrEmpty(BrandId) || string.IsNullOrEmpty(MakerCode) || string.IsNullOrEmpty(StoreNo))
+                    {
+                        return "失败,请检查机具Sn、品牌、创客编号、仓库编号是否为空!";
+                    }
                     UserForMakerCode userForMakerCode = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode);
                     UserForMakerCode userForMakerCode = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode);
+                    if (userForMakerCode == null)
+                    {
+                        return "未找到创客" + MakerCode + "相关创客关联数据" + '\n';
+                    }
                     StoreForCode storeForCode = db.StoreForCode.FirstOrDefault(m => m.Code == StoreNo);
                     StoreForCode storeForCode = db.StoreForCode.FirstOrDefault(m => m.Code == StoreNo);
+                    if (storeForCode == null)
+                    {
+                        return "未找到仓库" + StoreNo + "相关关联数据" + '\n';
+                    }
                     var store = db.StoreHouse.FirstOrDefault(m => m.Id == storeForCode.StoreId && m.BrandId == BrandId) ?? new StoreHouse();
                     var store = db.StoreHouse.FirstOrDefault(m => m.Id == storeForCode.StoreId && m.BrandId == BrandId) ?? new StoreHouse();
                     MachineForSnNo machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == PosSn) ?? new MachineForSnNo();
                     MachineForSnNo machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == PosSn) ?? new MachineForSnNo();
+                    if (machineForSnNo == null)
+                    {
+                        return "未找到机具" + PosSn + "相关关联数据" + '\n';
+                    }
                     var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId && m.BrandId == Convert.ToInt32(BrandId) && m.BindingState == 0 && m.BuyUserId == userForMakerCode.UserId) ?? new PosMachinesTwo();
                     var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId && m.BrandId == Convert.ToInt32(BrandId) && m.BindingState == 0 && m.BuyUserId == userForMakerCode.UserId) ?? new PosMachinesTwo();
                     var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId && m.BrandId == Convert.ToInt32(BrandId) && m.BindingState == 0) ?? new PosMachinesTwo();
                     var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId && m.BrandId == Convert.ToInt32(BrandId) && m.BindingState == 0) ?? new PosMachinesTwo();
                     if (pos.Id == 0)
                     if (pos.Id == 0)
@@ -1043,6 +1059,31 @@ namespace MySystem.Areas.Admin.Controllers
                     else
                     else
                     {
                     {
                         PosSnList.Add(PosSn);
                         PosSnList.Add(PosSn);
+                    }
+                }
+                if (!string.IsNullOrEmpty(error))
+                {
+                    return "Warning|" + error;
+                }
+                else
+                {
+                    for (int i = 1; i < list.Count; i++)
+                    {
+                        JsonData dr = list[i];
+                        string itemJson = dr.ToJson();
+                        string PosSn = itemJson.Contains("\"A\"") ? dr["A"].ToString() : "";
+                        string BrandId = itemJson.Contains("\"B\"") ? dr["B"].ToString() : "";
+                        string MakerCode = itemJson.Contains("\"C\"") ? dr["C"].ToString() : "";
+                        string StoreNo = itemJson.Contains("\"D\"") ? dr["D"].ToString() : "";
+                        string No = itemJson.Contains("\"E\"") ? dr["E"].ToString() : "";
+                        string Remark = itemJson.Contains("\"F\"") ? dr["F"].ToString() : "";
+                        UserForMakerCode userForMakerCode = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode);
+                        StoreForCode storeForCode = db.StoreForCode.FirstOrDefault(m => m.Code == StoreNo);
+                        var store = db.StoreHouse.FirstOrDefault(m => m.Id == storeForCode.StoreId && m.BrandId == BrandId) ?? new StoreHouse();
+                        MachineForSnNo machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == PosSn) ?? new MachineForSnNo();
+                        var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId && m.BrandId == Convert.ToInt32(BrandId) && m.BindingState == 0 && m.BuyUserId == userForMakerCode.UserId) ?? new PosMachinesTwo();
+                        var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId && m.BrandId == Convert.ToInt32(BrandId) && m.BindingState == 0) ?? new PosMachinesTwo();
+
                         var fromStore = db.StoreHouse.FirstOrDefault(m => m.Id == pos.StoreId && m.BrandId == BrandId) ?? new StoreHouse();
                         var fromStore = db.StoreHouse.FirstOrDefault(m => m.Id == pos.StoreId && m.BrandId == BrandId) ?? new StoreHouse();
                         var toStore = db.StoreHouse.FirstOrDefault(m => m.Id == storeForCode.StoreId && m.BrandId == BrandId) ?? new StoreHouse();
                         var toStore = db.StoreHouse.FirstOrDefault(m => m.Id == storeForCode.StoreId && m.BrandId == BrandId) ?? new StoreHouse();
                         var user = db.Users.FirstOrDefault(m => m.Id == toStore.UserId) ?? new Users();
                         var user = db.Users.FirstOrDefault(m => m.Id == toStore.UserId) ?? new Users();
@@ -1059,219 +1100,210 @@ namespace MySystem.Areas.Admin.Controllers
                         }
                         }
                         userAccount.ValidAmount -= amount;
                         userAccount.ValidAmount -= amount;
                         db.SaveChanges();
                         db.SaveChanges();
-                        if (posInfo != null)
+                        if (fromStore.Id != toStore.Id)
                         {
                         {
-                            if (fromStore.Id != toStore.Id)
+                            var changeNo = "JJBH" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
+                            StoreStockChange stockchange = db.StoreStockChange.Add(new StoreStockChange()
                             {
                             {
-                                var changeNo = "JJBH" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
-                                StoreStockChange stockchange = db.StoreStockChange.Add(new StoreStockChange()
-                                {
-                                    CreateDate = DateTime.Now,
-                                    StoreId = fromStore.Id, //出货仓库
-                                    ToStoreId = toStore.Id, //发货仓库
-                                    BrandId = Convert.ToInt32(BrandId), //产品类型
-                                    ProductName = RelationClass.GetKqProductBrandInfo(Convert.ToInt32(BrandId)), //产品名称
-                                    ChangeNo = changeNo, //变更记录单号
-                                    BizBatchNo = No, //业务批次号
-                                    TransType = 4, //交易类型
-                                    SnNo = PosSn, //SN编号
-                                    StockOpDirect = 1, //库存操作方向
-                                    SnStatus = 1, //SN状态
-                                    DeviceVendor = posInfo.DeviceName, //设备厂商
-                                    DeviceModel = posInfo.DeviceKind, //设备型号
-                                    DeviceType = posInfo.DeviceType, //设备类型                    
-                                    SourceStoreId = posInfo.SourceStoreId, //源仓库编号
-                                    BrandType = posInfo.DeviceType, //品牌类型
-                                }).Entity;
-                                db.SaveChanges();
-
-                                db.StoreChangeHistory.Add(new StoreChangeHistory()
-                                {
-                                    CreateDate = DateTime.Now,
-                                    CreateMan = SysUserName,
-                                    UserId = user.Id, //创客
-                                    FromUserId = posInfo.BuyUserId,//来源创客
-                                    ToUserId = toStore.UserId,//接收创客
-                                    StoreId = fromStore.Id, //出货仓库
-                                    ToStoreId = toStore.Id, //发货仓库
-                                    BrandId = Convert.ToInt32(BrandId), //产品类型
-                                    ChangeRecordNo = changeNo, //变更记录单号
-                                    SeoTitle = "机具驳回仓库",
-                                    BizBatchNo = No, //业务批次号
-                                    TransType = 4,//驳回
-                                    SnNo = PosSn, //SN编号
-                                });
-                                db.SaveChanges();
+                                CreateDate = DateTime.Now,
+                                StoreId = fromStore.Id, //出货仓库
+                                ToStoreId = toStore.Id, //发货仓库
+                                BrandId = Convert.ToInt32(BrandId), //产品类型
+                                ProductName = RelationClass.GetKqProductBrandInfo(Convert.ToInt32(BrandId)), //产品名称
+                                ChangeNo = changeNo, //变更记录单号
+                                BizBatchNo = No, //业务批次号
+                                TransType = 4, //交易类型
+                                SnNo = PosSn, //SN编号
+                                StockOpDirect = 1, //库存操作方向
+                                SnStatus = 1, //SN状态
+                                DeviceVendor = posInfo.DeviceName, //设备厂商
+                                DeviceModel = posInfo.DeviceKind, //设备型号
+                                DeviceType = posInfo.DeviceType, //设备类型                    
+                                SourceStoreId = posInfo.SourceStoreId, //源仓库编号
+                                BrandType = posInfo.DeviceType, //品牌类型
+                            }).Entity;
+                            db.SaveChanges();
 
 
-                                StoreBalance fbalance = db.StoreBalance.Add(new StoreBalance()
-                                {
-                                    CreateDate = DateTime.Now,
-                                    StoreId = fromStore.Id, //仓库
-                                    BrandId = Convert.ToInt32(BrandId), //产品类型
-                                    OpStoreNum = 1, //操作库存数
-                                    OpSymbol = "-", //操作符
-                                    BeforeTotalNum = fromStore.TotalNum, //操作前总库存数
-                                    AfterTotalNum = fromStore.TotalNum - 1, //操作后总库存数
-                                    BeforeLaveNum = fromStore.LaveNum, //操作前剩余库存数
-                                    AfterLaveNum = fromStore.LaveNum - 1, //操作后剩余库存数
-                                    BeforeOutNum = fromStore.OutNum, //操作前出库数
-                                    AfterOutNum = fromStore.OutNum - 1, //操作后出库数
-                                }).Entity;
-                                db.SaveChanges();
+                            db.StoreChangeHistory.Add(new StoreChangeHistory()
+                            {
+                                CreateDate = DateTime.Now,
+                                CreateMan = SysUserName,
+                                UserId = user.Id, //创客
+                                FromUserId = posInfo.BuyUserId,//来源创客
+                                ToUserId = toStore.UserId,//接收创客
+                                StoreId = fromStore.Id, //出货仓库
+                                ToStoreId = toStore.Id, //发货仓库
+                                BrandId = Convert.ToInt32(BrandId), //产品类型
+                                ChangeRecordNo = changeNo, //变更记录单号
+                                SeoTitle = "机具驳回仓库",
+                                BizBatchNo = No, //业务批次号
+                                TransType = 4,//驳回
+                                SnNo = PosSn, //SN编号
+                            });
+                            db.SaveChanges();
 
 
-                                StoreBalance tbalance = db.StoreBalance.Add(new StoreBalance()
-                                {
-                                    CreateDate = DateTime.Now,
-                                    StoreId = toStore.Id, //仓库
-                                    BrandId = Convert.ToInt32(BrandId), //产品类型
-                                    OpStoreNum = 1, //操作库存数
-                                    OpSymbol = "+", //操作符
-                                    BeforeTotalNum = toStore.TotalNum, //操作前总库存数
-                                    AfterTotalNum = toStore.TotalNum + 1, //操作后总库存数
-                                    BeforeLaveNum = toStore.LaveNum, //操作前剩余库存数
-                                    AfterLaveNum = toStore.LaveNum + 1, //操作后剩余库存数
-                                    BeforeOutNum = toStore.OutNum, //操作前出库数
-                                    AfterOutNum = toStore.OutNum, //操作后出库数
-                                }).Entity;
-                                db.SaveChanges();
+                            StoreBalance fbalance = db.StoreBalance.Add(new StoreBalance()
+                            {
+                                CreateDate = DateTime.Now,
+                                StoreId = fromStore.Id, //仓库
+                                BrandId = Convert.ToInt32(BrandId), //产品类型
+                                OpStoreNum = 1, //操作库存数
+                                OpSymbol = "-", //操作符
+                                BeforeTotalNum = fromStore.TotalNum, //操作前总库存数
+                                AfterTotalNum = fromStore.TotalNum - 1, //操作后总库存数
+                                BeforeLaveNum = fromStore.LaveNum, //操作前剩余库存数
+                                AfterLaveNum = fromStore.LaveNum - 1, //操作后剩余库存数
+                                BeforeOutNum = fromStore.OutNum, //操作前出库数
+                                AfterOutNum = fromStore.OutNum - 1, //操作后出库数
+                            }).Entity;
+                            db.SaveChanges();
 
 
-                                if (!opData.Contains(posInfo.BuyUserId + ":" + posInfo.BrandId))
-                                {
-                                    opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
-                                }
+                            StoreBalance tbalance = db.StoreBalance.Add(new StoreBalance()
+                            {
+                                CreateDate = DateTime.Now,
+                                StoreId = toStore.Id, //仓库
+                                BrandId = Convert.ToInt32(BrandId), //产品类型
+                                OpStoreNum = 1, //操作库存数
+                                OpSymbol = "+", //操作符
+                                BeforeTotalNum = toStore.TotalNum, //操作前总库存数
+                                AfterTotalNum = toStore.TotalNum + 1, //操作后总库存数
+                                BeforeLaveNum = toStore.LaveNum, //操作前剩余库存数
+                                AfterLaveNum = toStore.LaveNum + 1, //操作后剩余库存数
+                                BeforeOutNum = toStore.OutNum, //操作前出库数
+                                AfterOutNum = toStore.OutNum, //操作后出库数
+                            }).Entity;
+                            db.SaveChanges();
 
 
-                                posInfo.StoreId = toStore.Id;
-                                posInfo.BuyUserId = 0;
-                                posInfo.UserId = 0;
-                                posInfo.RecycEndDate = null;
-                                posInfo.PosSnType = 0;
-                                posInfo.BindMerchantId = 0;
-                                posInfo.ActivityList = null;
-                                posInfo.ScanQrTrade = 0;
-                                posInfo.DebitCardTrade = 0;
-                                posInfo.PrizeParams = null;
-                                posInfo.IsVip = 0;
-                                posInfo.CreditTrade = 0;
-                                posInfo.UserNav = null;
-                                posInfo.TransferTime = null;
-                                posInfo.IsPurchase = 0;
-                                posInfo.BindingTime = null;
-                                posInfo.BindingState = 0;
-                                posInfo.ActivationTime = null;
-                                posInfo.ActivationState = 0;
-                                posInfo.LeaderUserId = 0;
-                                posInfo.PreUserId = 0;
-                                posInfo.IsFirst = 0;
-                                fuserMachineData.TotalMachineCount -= 1;
-                                fuserMachineData.UnBindCount -= 1;
-                                toStore.TotalNum += 1;
-                                toStore.LaveNum += 1;
-                                fromStore.TotalNum -= 1;
-                                fromStore.LaveNum -= 1;
-                                PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
-                                db.SaveChanges();
-                            }
-                            else
+                            if (!opData.Contains(posInfo.BuyUserId + ":" + posInfo.BrandId))
                             {
                             {
-                                var changeNo = "JJBH" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
-                                StoreStockChange stockchange = db.StoreStockChange.Add(new StoreStockChange()
-                                {
-                                    CreateDate = DateTime.Now,
-                                    StoreId = fromStore.Id, //出货仓库
-                                    ToStoreId = toStore.Id, //发货仓库
-                                    BrandId = Convert.ToInt32(BrandId), //产品类型
-                                    ProductName = RelationClass.GetKqProductBrandInfo(Convert.ToInt32(BrandId)), //产品名称
-                                    ChangeNo = changeNo, //变更记录单号
-                                    BizBatchNo = No, //业务批次号
-                                    TransType = 4, //交易类型
-                                    SnNo = PosSn, //SN编号
-                                    StockOpDirect = 1, //库存操作方向
-                                    SnStatus = 1, //SN状态
-                                    DeviceVendor = posInfo.DeviceName, //设备厂商
-                                    DeviceModel = posInfo.DeviceKind, //设备型号
-                                    DeviceType = posInfo.DeviceType, //设备类型                    
-                                    SourceStoreId = posInfo.SourceStoreId, //源仓库编号
-                                    BrandType = posInfo.DeviceType, //品牌类型
-                                }).Entity;
-                                db.SaveChanges();
+                                opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
+                            }
 
 
-                                db.StoreChangeHistory.Add(new StoreChangeHistory()
-                                {
-                                    CreateDate = DateTime.Now,
-                                    CreateMan = SysUserName,
-                                    UserId = user.Id, //创客
-                                    FromUserId = user.Id,//来源创客
-                                    ToUserId = toStore.UserId,//接收创客
-                                    StoreId = fromStore.Id, //出货仓库
-                                    ToStoreId = toStore.Id, //发货仓库
-                                    BrandId = Convert.ToInt32(BrandId), //产品类型
-                                    ChangeRecordNo = changeNo, //变更记录单号
-                                    SeoTitle = "机具驳回仓库",
-                                    BizBatchNo = No, //业务批次号
-                                    SnNo = PosSn, //SN编号
-                                    TransType = 4,//驳回
-                                });
-                                db.SaveChanges();
+                            posInfo.StoreId = toStore.Id;
+                            posInfo.BuyUserId = 0;
+                            posInfo.UserId = 0;
+                            posInfo.RecycEndDate = null;
+                            posInfo.PosSnType = 0;
+                            posInfo.BindMerchantId = 0;
+                            posInfo.ActivityList = null;
+                            posInfo.ScanQrTrade = 0;
+                            posInfo.DebitCardTrade = 0;
+                            posInfo.PrizeParams = null;
+                            posInfo.IsVip = 0;
+                            posInfo.CreditTrade = 0;
+                            posInfo.UserNav = null;
+                            posInfo.TransferTime = null;
+                            posInfo.IsPurchase = 0;
+                            posInfo.BindingTime = null;
+                            posInfo.BindingState = 0;
+                            posInfo.ActivationTime = null;
+                            posInfo.ActivationState = 0;
+                            posInfo.LeaderUserId = 0;
+                            posInfo.PreUserId = 0;
+                            posInfo.IsFirst = 0;
+                            fuserMachineData.TotalMachineCount -= 1;
+                            fuserMachineData.UnBindCount -= 1;
+                            toStore.TotalNum += 1;
+                            toStore.LaveNum += 1;
+                            fromStore.TotalNum -= 1;
+                            fromStore.LaveNum -= 1;
+                            PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
+                            db.SaveChanges();
+                        }
+                        else
+                        {
+                            var changeNo = "JJBH" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
+                            StoreStockChange stockchange = db.StoreStockChange.Add(new StoreStockChange()
+                            {
+                                CreateDate = DateTime.Now,
+                                StoreId = fromStore.Id, //出货仓库
+                                ToStoreId = toStore.Id, //发货仓库
+                                BrandId = Convert.ToInt32(BrandId), //产品类型
+                                ProductName = RelationClass.GetKqProductBrandInfo(Convert.ToInt32(BrandId)), //产品名称
+                                ChangeNo = changeNo, //变更记录单号
+                                BizBatchNo = No, //业务批次号
+                                TransType = 4, //交易类型
+                                SnNo = PosSn, //SN编号
+                                StockOpDirect = 1, //库存操作方向
+                                SnStatus = 1, //SN状态
+                                DeviceVendor = posInfo.DeviceName, //设备厂商
+                                DeviceModel = posInfo.DeviceKind, //设备型号
+                                DeviceType = posInfo.DeviceType, //设备类型                    
+                                SourceStoreId = posInfo.SourceStoreId, //源仓库编号
+                                BrandType = posInfo.DeviceType, //品牌类型
+                            }).Entity;
+                            db.SaveChanges();
 
 
-                                StoreBalance balance = db.StoreBalance.Add(new StoreBalance()
-                                {
-                                    CreateDate = DateTime.Now,
-                                    StoreId = fromStore.Id, //仓库
-                                    BrandId = Convert.ToInt32(BrandId), //产品类型
-                                    OpStoreNum = 1, //操作库存数
-                                    OpSymbol = "-", //操作符
-                                    BeforeTotalNum = fromStore.TotalNum, //操作前总库存数
-                                    AfterTotalNum = fromStore.TotalNum - 1, //操作后总库存数
-                                    BeforeLaveNum = fromStore.LaveNum, //操作前剩余库存数
-                                    AfterLaveNum = fromStore.LaveNum - 1, //操作后剩余库存数
-                                    BeforeOutNum = fromStore.OutNum, //操作前出库数
-                                    AfterOutNum = fromStore.OutNum - 1, //操作后出库数
-                                }).Entity;
-                                db.SaveChanges();
+                            db.StoreChangeHistory.Add(new StoreChangeHistory()
+                            {
+                                CreateDate = DateTime.Now,
+                                CreateMan = SysUserName,
+                                UserId = user.Id, //创客
+                                FromUserId = user.Id,//来源创客
+                                ToUserId = toStore.UserId,//接收创客
+                                StoreId = fromStore.Id, //出货仓库
+                                ToStoreId = toStore.Id, //发货仓库
+                                BrandId = Convert.ToInt32(BrandId), //产品类型
+                                ChangeRecordNo = changeNo, //变更记录单号
+                                SeoTitle = "机具驳回仓库",
+                                BizBatchNo = No, //业务批次号
+                                SnNo = PosSn, //SN编号
+                                TransType = 4,//驳回
+                            });
+                            db.SaveChanges();
 
 
-                                if (!opData.Contains(posInfo.BuyUserId + ":" + posInfo.BrandId))
-                                {
-                                    opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
-                                }
+                            StoreBalance balance = db.StoreBalance.Add(new StoreBalance()
+                            {
+                                CreateDate = DateTime.Now,
+                                StoreId = fromStore.Id, //仓库
+                                BrandId = Convert.ToInt32(BrandId), //产品类型
+                                OpStoreNum = 1, //操作库存数
+                                OpSymbol = "-", //操作符
+                                BeforeTotalNum = fromStore.TotalNum, //操作前总库存数
+                                AfterTotalNum = fromStore.TotalNum - 1, //操作后总库存数
+                                BeforeLaveNum = fromStore.LaveNum, //操作前剩余库存数
+                                AfterLaveNum = fromStore.LaveNum - 1, //操作后剩余库存数
+                                BeforeOutNum = fromStore.OutNum, //操作前出库数
+                                AfterOutNum = fromStore.OutNum - 1, //操作后出库数
+                            }).Entity;
+                            db.SaveChanges();
 
 
-                                posInfo.StoreId = toStore.Id;
-                                posInfo.BuyUserId = 0;
-                                posInfo.UserId = 0;
-                                posInfo.RecycEndDate = null;
-                                posInfo.PosSnType = 0;
-                                posInfo.BindMerchantId = 0;
-                                posInfo.ActivityList = null;
-                                posInfo.ScanQrTrade = 0;
-                                posInfo.DebitCardTrade = 0;
-                                posInfo.PrizeParams = null;
-                                posInfo.IsVip = 0;
-                                posInfo.CreditTrade = 0;
-                                posInfo.UserNav = null;
-                                posInfo.TransferTime = null;
-                                posInfo.IsPurchase = 0;
-                                posInfo.BindingTime = null;
-                                posInfo.BindingState = 0;
-                                posInfo.ActivationTime = null;
-                                posInfo.ActivationState = 0;
-                                posInfo.LeaderUserId = 0;
-                                posInfo.PreUserId = 0;
-                                posInfo.IsFirst = 0;
-                                fuserMachineData.TotalMachineCount -= 1;
-                                fuserMachineData.UnBindCount -= 1;
-                                toStore.LaveNum += 1;
-                                toStore.TotalNum += 1;
-                                PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
-                                db.SaveChanges();
+                            if (!opData.Contains(posInfo.BuyUserId + ":" + posInfo.BrandId))
+                            {
+                                opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
                             }
                             }
-                            db.SaveChanges();
 
 
+                            posInfo.StoreId = toStore.Id;
+                            posInfo.BuyUserId = 0;
+                            posInfo.UserId = 0;
+                            posInfo.RecycEndDate = null;
+                            posInfo.PosSnType = 0;
+                            posInfo.BindMerchantId = 0;
+                            posInfo.ActivityList = null;
+                            posInfo.ScanQrTrade = 0;
+                            posInfo.DebitCardTrade = 0;
+                            posInfo.PrizeParams = null;
+                            posInfo.IsVip = 0;
+                            posInfo.CreditTrade = 0;
+                            posInfo.UserNav = null;
+                            posInfo.TransferTime = null;
+                            posInfo.IsPurchase = 0;
+                            posInfo.BindingTime = null;
+                            posInfo.BindingState = 0;
+                            posInfo.ActivationTime = null;
+                            posInfo.ActivationState = 0;
+                            posInfo.LeaderUserId = 0;
+                            posInfo.PreUserId = 0;
+                            posInfo.IsFirst = 0;
+                            fuserMachineData.TotalMachineCount -= 1;
+                            fuserMachineData.UnBindCount -= 1;
+                            toStore.LaveNum += 1;
+                            toStore.TotalNum += 1;
+                            PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
+                            db.SaveChanges();
                         }
                         }
+                        db.SaveChanges();
                     }
                     }
-
-                }
-                if (!string.IsNullOrEmpty(error))
-                {
-                    return "Warning|" + error;
                 }
                 }
                 foreach (string sub in opData)
                 foreach (string sub in opData)
                 {
                 {

+ 69 - 13
Areas/Admin/Controllers/MainServer/UserCashRecordController.cs

@@ -96,7 +96,14 @@ namespace MySystem.Areas.Admin.Controllers
             //提交到代付状态
             //提交到代付状态
             if (!string.IsNullOrEmpty(QueryCountSelect))
             if (!string.IsNullOrEmpty(QueryCountSelect))
             {
             {
-                condition += " and QueryCount=" + QueryCountSelect;
+                if(QueryCountSelect == "0")
+                {
+                    condition += " and QueryCount=" + QueryCountSelect;
+                }
+                else
+                {
+                    condition += " and QueryCount>0";
+                }
             }
             }
 
 
             if (!string.IsNullOrEmpty(CreateDateData))
             if (!string.IsNullOrEmpty(CreateDateData))
@@ -157,7 +164,7 @@ namespace MySystem.Areas.Admin.Controllers
 
 
                 int QueryCount = int.Parse(dic["QueryCount"].ToString());
                 int QueryCount = int.Parse(dic["QueryCount"].ToString());
                 if (QueryCount == 0) dic["LockName"] = "待提交";
                 if (QueryCount == 0) dic["LockName"] = "待提交";
-                if (QueryCount == 1) dic["LockName"] = "已提交";
+                if (QueryCount > 0) dic["LockName"] = "已提交";
             }
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
             Dictionary<string, object> other = new Dictionary<string, object>();
 
 
@@ -488,11 +495,10 @@ namespace MySystem.Areas.Admin.Controllers
         /// 导出Excel
         /// 导出Excel
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
-        public JsonResult ExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string PayStatus)
+        public JsonResult ExportExcel(UserCashRecord data, string MakerCode, string RealName, string StatusSelect, string QueryCountSelect, string CreateDateData)
         {
         {
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("CashOrderNo", "1"); //提现单号
             Fields.Add("CashOrderNo", "1"); //提现单号
-            Fields.Add("CreateDate", "3"); //创建时间
             Fields.Add("TradeType", "0"); //交易类型
             Fields.Add("TradeType", "0"); //交易类型
 
 
             string condition = " and Status>-1 and TradeType<3";
             string condition = " and Status>-1 and TradeType<3";
@@ -511,15 +517,67 @@ namespace MySystem.Areas.Admin.Controllers
             {
             {
                 condition += " and Status=" + StatusSelect;
                 condition += " and Status=" + StatusSelect;
             }
             }
+            if (!string.IsNullOrEmpty(data.CashOrderNo))
+            {
+                condition += " and CashOrderNo='" + data.CashOrderNo + "'";
+            }
+            if (data.TradeType > 0)
+            {
+                condition += " and TradeType=" + data.TradeType;
+            }
             //提交到代付状态
             //提交到代付状态
-            if (!string.IsNullOrEmpty(PayStatus))
+            if (!string.IsNullOrEmpty(QueryCountSelect))
             {
             {
-                int QueryCount = int.Parse(function.CheckInt(PayStatus));
-                if (QueryCount == 2)
+                if(QueryCountSelect == "0")
                 {
                 {
-                    QueryCount = 0;
+                    condition += " and QueryCount=" + QueryCountSelect;
+                }
+                else
+                {
+                    condition += " and QueryCount>0";
+                }
+            }
+
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                var start = Convert.ToDateTime(Convert.ToDateTime(datelist[0]).ToString("yyyy-MM-dd"));
+                var end = Convert.ToDateTime(Convert.ToDateTime(datelist[1]).ToString("yyyy-MM-dd") + " 23:59:59");
+                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
+                var checks = db.UserCashRecord.Any(m => m.CreateDate <= end && m.TradeType < 3);
+                if (check)
+                {
+                    var sId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
+                    condition += "  and Id >=" + sId;
+                }
+                if (checks)
+                {
+                    var eId = db.UserCashRecord.Where(m => m.CreateDate <= end && m.TradeType < 3).Max(m => m.Id);
+                    condition += " and Id <=" + eId;
+                }
+            }
+            else
+            {
+                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
+                var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
+                if (check)
+                {
+                    var minId = db.UserCashRecord.Where(m => m.CreateDate >= start && m.TradeType < 3).Min(m => m.Id);
+                    var Info = function.ReadInstance("/WritePage/UserCashRecord/UserCashRecord.txt");
+                    if (string.IsNullOrEmpty(Info.ToString()))
+                    {
+                        function.WritePage("/WritePage/UserCashRecord/", "UserCashRecord.txt", minId.ToString());
+                        condition += " and Id >=" + minId;
+                    }
+                    else
+                    {
+                        condition += " and Id >=" + Convert.ToInt32(Info);
+                    }
+                }
+                else
+                {
+                    condition += " and Id =0";
                 }
                 }
-                condition += " and QueryCount=" + QueryCount;
             }
             }
 
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("UserCashRecord", Fields, "Id desc", "0", 1, 20000, condition, "CashOrderNo,UserId,IdCardNo,ActualTradeAmount,Remark,Status,QueryCount,CreateDate", false);
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("UserCashRecord", Fields, "Id desc", "0", 1, 20000, condition, "CashOrderNo,UserId,IdCardNo,ActualTradeAmount,Remark,Status,QueryCount,CreateDate", false);
@@ -530,9 +588,7 @@ namespace MySystem.Areas.Admin.Controllers
                 Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
                 Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
                 dic["MakerCode"] = user.MakerCode;
                 dic["MakerCode"] = user.MakerCode;
                 dic["RealName"] = user.RealName;
                 dic["RealName"] = user.RealName;
-                dic["Mobile"] = user.Mobile;
-                dic["SettleBankName"] = user.SettleBankName;
-                dic["SettleBankCardNo"] = user.SettleBankCardNo;
+                dic["TradeType"] = RelationClassForConst.GetTradeTypeInfo(int.Parse(dic["TradeType"].ToString()));
                 dic.Remove("UserId");
                 dic.Remove("UserId");
                 int Status = int.Parse(dic["Status"].ToString());
                 int Status = int.Parse(dic["Status"].ToString());
                 if (Status == 0) dic["StatusName"] = "处理中";
                 if (Status == 0) dic["StatusName"] = "处理中";
@@ -542,7 +598,7 @@ namespace MySystem.Areas.Admin.Controllers
 
 
                 int QueryCount = int.Parse(dic["QueryCount"].ToString());
                 int QueryCount = int.Parse(dic["QueryCount"].ToString());
                 if (QueryCount == 0) dic["LockName"] = "待提交";
                 if (QueryCount == 0) dic["LockName"] = "待提交";
-                if (QueryCount == 1) dic["LockName"] = "已提交";
+                if (QueryCount > 0) dic["LockName"] = "已提交";
                 dic.Remove("QueryCount");
                 dic.Remove("QueryCount");
             }
             }
 
 

+ 6 - 5
Areas/Admin/Views/BsServer/Advertisment/Add.cshtml

@@ -2,6 +2,7 @@
     string RightInfo = ViewBag.RightInfo as string;
     string RightInfo = ViewBag.RightInfo as string;
     string right = ViewBag.right as string;
     string right = ViewBag.right as string;
     string SysUserName = ViewBag.SysUserName as string;
     string SysUserName = ViewBag.SysUserName as string;
+    string CurColId = ViewBag.CurColId as string;
 }
 }
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
@@ -28,16 +29,16 @@
                     <div class="layui-form-item">
                     <div class="layui-form-item">
                         <label class="layui-form-label">标题</label>
                         <label class="layui-form-label">标题</label>
                         <div class="layui-input-block">
                         <div class="layui-input-block">
-                            <input class="layui-input" type="text" id="Title" name="Title" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入标题">
+                            <input class="layui-input" type="text" id="Title" name="Title" maxlength="50" lay-verify="required|" autocomplete="off" placeholder="请输入标题">
                         </div>
                         </div>
                     </div>
                     </div>
                     <div class="layui-form-item">
                     <div class="layui-form-item">
                         <div class="layui-inline">
                         <div class="layui-inline">
                             <label class="layui-form-label">分类</label>
                             <label class="layui-form-label">分类</label>
                             <div class="layui-input-inline">
                             <div class="layui-input-inline">
-                                <select id="ColId" name="ColId" lay-search="">
+                                <select id="ColId" name="ColId" lay-search="" lay-verify="required|" placeholder="请选择分类">
                                     <option value="">请选择</option>
                                     <option value="">请选择</option>
-                                    @{Dictionary<string, string> ColDic = new MySystem.DictionaryClass().getColDic("003");}
+                                    @{Dictionary<string, string> ColDic = new MySystem.DictionaryClass().getColDic(CurColId);}
                                     @foreach (string key in ColDic.Keys)
                                     @foreach (string key in ColDic.Keys)
                                     {
                                     {
                                         string kg = "";
                                         string kg = "";
@@ -55,7 +56,7 @@
                         <label class="layui-form-label">图片</label>
                         <label class="layui-form-label">图片</label>
                         <div class="layui-input-block">
                         <div class="layui-input-block">
                             <div class="layui-upload">
                             <div class="layui-upload">
-                                <input type="hidden" id="PicPath" name="PicPath" value="">
+                                <input type="hidden" id="PicPath" name="PicPath" value="" lay-verify="required|">
                                 <button class="layui-btn" type="button" id="PicPathBtn">选择图片</button>
                                 <button class="layui-btn" type="button" id="PicPathBtn">选择图片</button>
                                 <div class="layui-inline layui-word-aux"></div>
                                 <div class="layui-inline layui-word-aux"></div>
                             </div>
                             </div>
@@ -66,7 +67,7 @@
                     <div class="layui-form-item layui-form-text">
                     <div class="layui-form-item layui-form-text">
                         <label class="layui-form-label">内容</label>
                         <label class="layui-form-label">内容</label>
                         <div class="layui-input-block">
                         <div class="layui-input-block">
-                            <textarea class="layui-textarea" id="Contents" name="Contents" placeholder="请输入内容" style="width:100%;height:500px;"></textarea>
+                            <textarea class="layui-textarea" id="Contents" name="Contents" style="width:100%;height:500px;"></textarea>
                         </div>
                         </div>
                     </div>
                     </div>
                     <div class="layui-form-item">
                     <div class="layui-form-item">

+ 5 - 4
Areas/Admin/Views/BsServer/Advertisment/Edit.cshtml

@@ -4,6 +4,7 @@
     string RightInfo = ViewBag.RightInfo as string;
     string RightInfo = ViewBag.RightInfo as string;
     string right = ViewBag.right as string;
     string right = ViewBag.right as string;
     string SysUserName = ViewBag.SysUserName as string;
     string SysUserName = ViewBag.SysUserName as string;
+    string CurColId = ViewBag.CurColId as string;
 }
 }
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
@@ -31,16 +32,16 @@
                     <div class="layui-form-item">
                     <div class="layui-form-item">
                         <label class="layui-form-label">标题</label>
                         <label class="layui-form-label">标题</label>
                         <div class="layui-input-block">
                         <div class="layui-input-block">
-                            <input class="layui-input" type="text" id="Title" name="Title" value="@editData.Title" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入标题">
+                            <input class="layui-input" type="text" id="Title" name="Title" value="@editData.Title" maxlength="50" lay-verify="required|" autocomplete="off" placeholder="请输入标题">
                         </div>
                         </div>
                     </div>
                     </div>
                     <div class="layui-form-item">
                     <div class="layui-form-item">
                         <div class="layui-inline">
                         <div class="layui-inline">
                             <label class="layui-form-label">分类</label>
                             <label class="layui-form-label">分类</label>
                             <div class="layui-input-inline">
                             <div class="layui-input-inline">
-                                <select id="ColId" name="ColId" lay-search="">
+                                <select id="ColId" name="ColId" lay-search="" lay-verify="required|" placeholder="请选择分类">
                                     <option value="">请选择</option>
                                     <option value="">请选择</option>
-                                    @{Dictionary<string, string> ColDic = new MySystem.DictionaryClass().getColDic("003");}
+                                    @{Dictionary<string, string> ColDic = new MySystem.DictionaryClass().getColDic(CurColId);}
                                     @foreach (string key in ColDic.Keys)
                                     @foreach (string key in ColDic.Keys)
                                     {
                                     {
                                         string kg = "";
                                         string kg = "";
@@ -59,7 +60,7 @@
                         <label class="layui-form-label">图片</label>
                         <label class="layui-form-label">图片</label>
                         <div class="layui-input-block">
                         <div class="layui-input-block">
                             <div class="layui-upload">
                             <div class="layui-upload">
-                                <input type="hidden" id="PicPath" name="PicPath" value="@editData.PicPath">
+                                <input type="hidden" id="PicPath" name="PicPath" value="@editData.PicPath" lay-verify="required|" placeholder="请输入图片">
                                 <button class="layui-btn" type="button" id="PicPathBtn">选择图片</button>
                                 <button class="layui-btn" type="button" id="PicPathBtn">选择图片</button>
                                 <div class="layui-inline layui-word-aux"></div>
                                 <div class="layui-inline layui-word-aux"></div>
                             </div>
                             </div>

+ 5 - 0
Areas/Admin/Views/BsServer/Advertisment/Index.cshtml

@@ -1,6 +1,7 @@
 @{
 @{
     string RightInfo = ViewBag.RightInfo as string;
     string RightInfo = ViewBag.RightInfo as string;
     string right = ViewBag.right as string;
     string right = ViewBag.right as string;
+    string CurColId = ViewBag.CurColId as string;
 }
 }
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
@@ -92,5 +93,9 @@
 
 
     <script src="/layuiadmin/layui/layui.js"></script>
     <script src="/layuiadmin/layui/layui.js"></script>
     <script src="/layuiadmin/modules/Advertisment_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
     <script src="/layuiadmin/modules/Advertisment_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+        var CurColId = '@CurColId';
+        var right = '@right';
+    </script>
 </body>
 </body>
 </html>
 </html>

+ 2 - 2
wwwroot/layuiadmin/modules/Advertisment_Admin.js

@@ -61,7 +61,7 @@ layui.config({
     //列表数据
     //列表数据
     table.render({
     table.render({
         elem: '#LAY-list-manage'
         elem: '#LAY-list-manage'
-        , url: '/Admin/Advertisment/IndexData' //模拟接口
+        , url: '/Admin/Advertisment/IndexData?CurColId=' + CurColId //模拟接口
         , cols: [[
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
             { type: 'checkbox', fixed: 'left' }
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
@@ -208,7 +208,7 @@ layui.config({
             var perContent = layer.open({
             var perContent = layer.open({
                 type: 2
                 type: 2
                 , title: '广告位-添加'
                 , title: '广告位-添加'
-                , content: 'Add'
+                , content: 'Add?CurColId=' + CurColId
                 , maxmin: true
                 , maxmin: true
                 , area: ['500px', '450px']
                 , area: ['500px', '450px']
                 , btn: ['确定', '取消']
                 , btn: ['确定', '取消']

+ 1 - 1
wwwroot/layuiadmin/modules_main/UserCashRecord_Admin.js

@@ -698,7 +698,7 @@ layui.config({
                         title: '提交到代付',
                         title: '提交到代付',
                         content: 'Cash',
                         content: 'Cash',
                         maxmin: true,
                         maxmin: true,
-                        area: ['500px', '450px'],
+                        area: ['500px', '250px'],
                         btn: ['确定', '取消'],
                         btn: ['确定', '取消'],
                         yes: function (index, layero) {
                         yes: function (index, layero) {
                             var iframeWindow = window['layui-layer-iframe' + index],
                             var iframeWindow = window['layui-layer-iframe' + index],