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

Merge branch 'develop' of http://47.109.31.237:13000/kxs-end/admin-server into feature-dgy-后台测试

# Conflicts:
#	.DS_Store
#	wwwroot/.DS_Store
DuGuYang 3 лет назад
Родитель
Сommit
59ba9540a5

+ 48 - 48
Areas/Admin/Controllers/HomeController.cs

@@ -149,60 +149,60 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string Login(string UserName, string Pwd, string CheckCode)
         {
-            // string result = "";
-            // if (function.GetCookie(_accessor.HttpContext, "checkcode") != CheckCode)
-            // {
-            //     result = "验证码错误!!";
-            // }
-            // else
-            // {
-            //     Pwd = function.MD5_32(Pwd);
-            //     var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
-            //     if (user != null)
-            //     {
-            //         user.LastLoginDate = DateTime.Now;
-            //         db.SaveChanges();
-            //         function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
-            //         function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
-            //         function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
-            //         int RoleId = int.Parse(function.CheckInt(user.Role));
-            //         BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
-            //         string RightInfo = function.CheckNull(Role.RightInfo);
-            //         function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
-            //         string UserId = user.Id.ToString();
-            //         function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
-            //         function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
-            //         result = "success";
-            //     }
-            //     else
-            //     {
-            //         result = "用户名或密码错误";
-            //     }
-            // }
-
             string result = "";
-            Pwd = function.MD5_32(Pwd);
-            var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
-            if (user != null)
+            if (function.GetCookie(_accessor.HttpContext, "checkcode") != CheckCode)
             {
-                user.LastLoginDate = DateTime.Now;
-                db.SaveChanges();
-                function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
-                function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
-                function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
-                int RoleId = int.Parse(function.CheckInt(user.Role));
-                BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
-                string RightInfo = function.CheckNull(Role.RightInfo);
-                function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
-                string UserId = user.Id.ToString();
-                function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
-                function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
-                result = "success";
+                result = "验证码错误!!";
             }
             else
             {
-                result = "用户名或密码错误";
+                Pwd = function.MD5_32(Pwd);
+                var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
+                if (user != null)
+                {
+                    user.LastLoginDate = DateTime.Now;
+                    db.SaveChanges();
+                    function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
+                    function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
+                    function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
+                    int RoleId = int.Parse(function.CheckInt(user.Role));
+                    BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
+                    string RightInfo = function.CheckNull(Role.RightInfo);
+                    function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
+                    string UserId = user.Id.ToString();
+                    function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
+                    function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
+                    result = "success";
+                }
+                else
+                {
+                    result = "用户名或密码错误";
+                }
             }
+
+            // string result = "";
+            // Pwd = function.MD5_32(Pwd);
+            // var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
+            // if (user != null)
+            // {
+            //     user.LastLoginDate = DateTime.Now;
+            //     db.SaveChanges();
+            //     function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
+            //     function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
+            //     function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
+            //     int RoleId = int.Parse(function.CheckInt(user.Role));
+            //     BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
+            //     string RightInfo = function.CheckNull(Role.RightInfo);
+            //     function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
+            //     string UserId = user.Id.ToString();
+            //     function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
+            //     function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
+            //     result = "success";
+            // }
+            // else
+            // {
+            //     result = "用户名或密码错误";
+            // }
             return result;
         }
         #endregion

+ 3 - 3
Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

@@ -539,7 +539,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -570,7 +570,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandIds == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -657,7 +657,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status > -1 && m.Sort == 0);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)

+ 7 - 4
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -655,6 +655,10 @@ namespace MySystem.Areas.Admin.Controllers
                         {
                             prizes.Add(50);
                         }
+                        else if (pos.BrandId == 12 && pos.IsFirst == 1 && ActPrize == 0) //盒易付首台无押金机返50
+                        {
+                            prizes.Add(50);
+                        }
                         foreach (decimal prize in prizes)
                         {
                             int ChangeType = prize == 40 ? 12 : 0;
@@ -3435,7 +3439,7 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     if (posInfo.Id > 0)
                     {
-                        PosId += posInfo.Id + ",";
+                        RedisDbconn.Instance.AddList("OpenRewardQueue", posInfo.Id.ToString());
                     }
 
                 }
@@ -3447,7 +3451,6 @@ namespace MySystem.Areas.Admin.Controllers
             PosId = PosId.TrimEnd(',');
             function.WriteLog(DateTime.Now.ToString() + ":请求参数," + PosId + ":" + SysUserName + "-" + SysRealName, "根据机具号补发开机奖励");
 
-            RedisDbconn.Instance.AddList("OpenRewardQueue", PosId);
             return "success";
         }
         #endregion
@@ -3803,7 +3806,7 @@ namespace MySystem.Areas.Admin.Controllers
                 var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Status > -1 && m.BindingState == 0 && m.ActivationState == 0 && m.PosSn == Sn && (m.BuyUserId == fUserId.Id || m.UserId == fUserId.Id)) ?? new PosMachinesTwo();
                 if (posInfo.Id == 0)
                 {
-                    error += "以下操作失败" + PosSn + ',' + "不存在或者不符合条件" + '\n';
+                    error += "以下操作失败" + Sn + ',' + "不存在或者不符合条件" + '\n';
                 }
                 else
                 {
@@ -4520,7 +4523,7 @@ namespace MySystem.Areas.Admin.Controllers
                     result += "激活时间:" + DateTime.Parse(pos.ActivationTime.ToString()).ToString("yyyy-MM-dd hh:mm:sss") + "\n";
                     result += "商户姓名:" + mer.MerRealName + "\n";
                     result += "明细:\n";
-                    for (int i = 0; i < 10; i++)
+                    for (int i = 0; i < 12; i++)
                     {
                         var time = DateTime.Parse(pos.ActivationTime.ToString()).AddMonths(i + 1).ToString("yyyyMM");//达标计算开始时间
                         timeInfo += "," + time;

+ 4 - 4
Areas/Admin/Controllers/OperateServer/StoreMachineApplyOperateController.cs

@@ -642,7 +642,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -673,7 +673,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandIds == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -705,7 +705,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 Models.MachineForSnNo posInfo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new Models.MachineForSnNo();
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posInfo.SnId && m.StoreId == FromStoreId && m.UserId == 0 && m.BuyUserId == 0 && m.PreUserId == 0) ?? new Models.PosMachinesTwo();
                 if (pos.BindingState == 1 || pos.ActivationState == 1)
@@ -773,7 +773,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.Sort > 0 && m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status == 1);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)

+ 4 - 4
Areas/Admin/Controllers/OperateServer/StoreMachineApplysOperateController.cs

@@ -539,7 +539,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -570,7 +570,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandIds == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -602,7 +602,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 MachineForSnNo posInfo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new MachineForSnNo();
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posInfo.SnId && m.StoreId == FromStoreId && m.UserId == 0 && m.BuyUserId == 0 && m.PreUserId == 0) ?? new PosMachinesTwo();
                 if (pos.BindingState == 1 || pos.ActivationState == 1)
@@ -657,7 +657,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 0;
+                if (BrandId == 12) FromStoreId = 5907;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.Sort > 0 && m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status == 1);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)

+ 2 - 2
Areas/Admin/Views/Home/Login.cshtml

@@ -26,11 +26,11 @@
                     <label for="password">密码 / Password</label>
                     <input class="form-input" type="password" name="Pwd" id="Pwd" onKeyUp="if(event.keyCode==13){$('#CheckCode').focus();}" placeholder="请填写密码">
                 </div>
-                @* <div class="form-group pb10">
+                <div class="form-group pb10">
                     <label for="password">验证码 / Verification</label>
                     <input class="form-input" type="text" name="CheckCode" id="CheckCode" onkeyup="if(event.keyCode==13){syslogin();}" placeholder="请填写验证码" style="width: 70%; display: inline-block; margin-right: 2%">
                     <img src="/Api/PublicMethod/CheckCode" onclick="$(this).attr('src','/Api/PublicMethod/CheckCode?r='+Math.random())" style="width: 26%; height:38px;" />
-                </div> *@
+                </div>
                 @*<div class="form-group pb10 cf">
                         <label class="remembermetext fl" for="rememberme">
                             <input type="checkbox" checked name="rememberme">&nbsp;记住我的登录

BIN
wwwroot/.DS_Store