Browse Source

Merge branch 'feature-dgy-新增服务费调整功能' into feature-dgy-后台测试

DuGuYang 2 years ago
parent
commit
45cf533c34

+ 16 - 16
AppStart/PublicChangePosFee.cs

@@ -21,9 +21,9 @@ namespace MySystem
         public static WebCMSEntities db = new WebCMSEntities();
 
         #region 金控-设置押金
-        public static string SetJKDeposit(string SnIds)
+        public static string SetJKDeposit(string SnIds,string DepositId)
         {
-            string DepositId = "299";
+            // string DepositId = "299";
             string check = RedisDbconn.Instance.Get<string>("SetJKPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -82,9 +82,9 @@ namespace MySystem
 
 
         #region 开店宝-设置押金
-        public static string SetKDBDeposit(string SnIds)
+        public static string SetKDBDeposit(string SnIds,string DepositId)
         {
-            string DepositId = "473";
+            // string DepositId = "473";
             string check = RedisDbconn.Instance.Get<string>("SetKDBPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -129,9 +129,9 @@ namespace MySystem
 
 
         #region 乐刷-设置押金
-        public static string SetLSDeposit(string SnIds)
+        public static string SetLSDeposit(string SnIds,string DepositId)
         {
-            string DepositId = "300";
+            // string DepositId = "300";
             string check = RedisDbconn.Instance.Get<string>("SetLSPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -206,9 +206,9 @@ namespace MySystem
 
 
         #region 立刷-设置押金
-        public static string SetLISDeposit(string SnIds)
+        public static string SetLISDeposit(string SnIds,string DepositId)
         {
-            string DepositId = "249";
+            // string DepositId = "249";
             string check = RedisDbconn.Instance.Get<string>("SetLISPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -261,9 +261,9 @@ namespace MySystem
 
 
         #region 盛付通-设置押金
-        public static string SetSFTDeposit(string SnIds)
+        public static string SetSFTDeposit(string SnIds,string DepositId)
         {
-            string DepositId = "2021POS299";
+            // string DepositId = "2021POS299";
             string check = RedisDbconn.Instance.Get<string>("SetSFTPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -309,9 +309,9 @@ namespace MySystem
 
 
         #region 海科-设置押金
-        public static string SetHKDeposit(string SnIds)
+        public static string SetHKDeposit(string SnIds,string DepositId)
         {
-            string DepositId = "300";
+            // string DepositId = "300";
             string check = RedisDbconn.Instance.Get<string>("SetHKPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -386,9 +386,9 @@ namespace MySystem
 
 
         #region 联动-设置押金
-        public static string SetLDDeposit(string SnIds)
+        public static string SetLDDeposit(string SnIds,string DepositId)
         {
-            string DepositId = "299";
+            // string DepositId = "299";
             string check = RedisDbconn.Instance.Get<string>("SetLDPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -434,9 +434,9 @@ namespace MySystem
 
 
         #region 盒易付-设置押金
-        public static string SetHYFDeposit(string SnIds)
+        public static string SetHYFDeposit(string SnIds,string DepositId)
         {
-            string DepositId = "299";
+            // string DepositId = "299";
             string check = RedisDbconn.Instance.Get<string>("SetHYFPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {

+ 47 - 10
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -5740,18 +5740,19 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         [HttpPost]
-        public string ChangePosFeeDo(string PosSn)
+        public string ChangePosFeeDo(string PosSn, string BrandId, string Deposit)
         {
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
             }
+            var brandId = int.Parse(BrandId);
             List<int> SnIds = new List<int>();
             string[] PosSnList = PosSn.Replace("\r", "").Replace("\n", ",").Split(',');
             string error = "";
             foreach (string Sn in PosSnList)
             {
-                var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Status > -1 && m.BindingState == 0 && m.ActivationState == 0 && m.PosSn == Sn) ?? new PosMachinesTwo();
+                var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Status > -1 && m.BindingState == 0 && m.ActivationState == 0 && m.PosSn == Sn && m.BrandId == brandId) ?? new PosMachinesTwo();
                 if (posInfo.Id == 0)
                 {
                     error += "以下操作失败" + Sn + ',' + "不存在或者不符合条件" + '\n';
@@ -5773,7 +5774,11 @@ namespace MySystem.Areas.Admin.Controllers
                     //金控
                     if (posInfo.BrandId == 1 || posInfo.BrandId == 3)
                     {
-                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (Deposit == "0") Deposit = "0";
+                        if (Deposit == "99") Deposit = "99";
+                        if (Deposit == "199") Deposit = "199";
+                        else return "失败,无" + Deposit + "相关服务费设置权限";
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString(), Deposit);
                         if (info != "设置成功")
                         {
                             return info;
@@ -5782,7 +5787,12 @@ namespace MySystem.Areas.Admin.Controllers
                     //开店宝
                     if (posInfo.BrandId == 2)
                     {
-                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (Deposit == "0") Deposit = "470";
+                        if (Deposit == "99") Deposit = "471";
+                        if (Deposit == "199") Deposit = "472";
+                        if (Deposit == "299") Deposit = "473";
+                        else return "失败,无" + Deposit + "相关服务费设置权限";
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString(), Deposit);
                         if (info != "设置成功")
                         {
                             return info;
@@ -5791,7 +5801,11 @@ namespace MySystem.Areas.Admin.Controllers
                     //乐刷
                     if (posInfo.BrandId == 4 || posInfo.BrandId == 5)
                     {
-                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (Deposit == "99") Deposit = "100";
+                        if (Deposit == "199") Deposit = "200";
+                        if (Deposit == "299") Deposit = "300";
+                        else return "失败,无" + Deposit + "相关服务费设置权限";
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString(), Deposit);
                         if (info != "设置成功")
                         {
                             return info;
@@ -5800,7 +5814,11 @@ namespace MySystem.Areas.Admin.Controllers
                     //立刷
                     if (posInfo.BrandId == 6)
                     {
-                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (Deposit == "0") Deposit = "0";
+                        if (Deposit == "99") Deposit = "99";
+                        if (Deposit == "199") Deposit = "199";
+                        else return "失败,无" + Deposit + "相关服务费设置权限";
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString(), Deposit);
                         if (info != "设置成功")
                         {
                             return info;
@@ -5809,7 +5827,12 @@ namespace MySystem.Areas.Admin.Controllers
                     //盛付通
                     if (posInfo.BrandId == 7)
                     {
-                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (Deposit == "0") Deposit = "0";
+                        if (Deposit == "99") Deposit = "99";
+                        if (Deposit == "199") Deposit = "199";
+                        if (Deposit == "249") Deposit = "249";
+                        else return "失败,无" + Deposit + "相关服务费设置权限";
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString(), Deposit);
                         if (info != "设置成功")
                         {
                             return info;
@@ -5818,7 +5841,11 @@ namespace MySystem.Areas.Admin.Controllers
                     //海科
                     if (posInfo.BrandId == 8 || posInfo.BrandId == 9)
                     {
-                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (Deposit == "99") Deposit = "100";
+                        if (Deposit == "199") Deposit = "200";
+                        if (Deposit == "299") Deposit = "300";
+                        else return "失败,无" + Deposit + "相关服务费设置权限";
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString(), Deposit);
                         if (info != "设置成功")
                         {
                             return info;
@@ -5827,7 +5854,12 @@ namespace MySystem.Areas.Admin.Controllers
                     //联动
                     if (posInfo.BrandId == 10 || posInfo.BrandId == 11)
                     {
-                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (Deposit == "0") Deposit = "0";
+                        if (Deposit == "99") Deposit = "99";
+                        if (Deposit == "199") Deposit = "199";
+                        if (Deposit == "299") Deposit = "299";
+                        else return "失败,无" + Deposit + "相关服务费设置权限";
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString(), Deposit);
                         if (info != "设置成功")
                         {
                             return info;
@@ -5836,7 +5868,12 @@ namespace MySystem.Areas.Admin.Controllers
                     //盒易付
                     if (posInfo.BrandId == 12 || posInfo.BrandId == 13)
                     {
-                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (Deposit == "0") Deposit = "0";
+                        if (Deposit == "99") Deposit = "99";
+                        if (Deposit == "199") Deposit = "199";
+                        if (Deposit == "299") Deposit = "299";
+                        else return "失败,无" + Deposit + "相关服务费设置权限";
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString(), Deposit);
                         if (info != "设置成功")
                         {
                             return info;

+ 26 - 0
Areas/Admin/Views/MainServer/SysTools/ChangePosFee.cshtml

@@ -30,6 +30,32 @@
                         </ul>
                         <div class="layui-tab-content mt20">
                             <div class="layui-tab-item layui-show">
+                                @{
+                                    Dictionary<string, string> ProfitObjectsActivesDic = new MySystem.DictionaryClass().getKqProductBrandDic();
+                                }
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">品牌</label>
+                                    <div class="layui-input-inline">
+                                        <select id="BrandId" name="BrandId" lay-search="">
+                                            @foreach (string key in ProfitObjectsActivesDic.Keys)
+                                            {
+                                                <option value="@key">@ProfitObjectsActivesDic[key]</option>
+                                            }
+                                        </select>
+                                    </div>
+                                </div>
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">服务费</label>
+                                    <div class="layui-input-inline">
+                                        <select id="Deposit" name="Deposit" lay-search="">
+                                            <option value="1">0服务费</option>
+                                            <option value="99">99服务费</option>
+                                            <option value="199">199服务费</option>
+                                            <option value="249">249服务费</option>
+                                            <option value="299">299服务费</option>
+                                        </select>
+                                    </div>
+                                </div>
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">机具SN</label>
                                     <div class="layui-input-block">