소스 검색

调整设置服务费

lcl 1 년 전
부모
커밋
99e0d3404f
2개의 변경된 파일21개의 추가작업 그리고 5개의 파일을 삭제
  1. BIN
      .DS_Store
  2. 21 5
      AppStart/Helper/ChangePosFeeUtil.cs

BIN
.DS_Store


+ 21 - 5
AppStart/Helper/ChangePosFeeUtil.cs

@@ -10,9 +10,7 @@ namespace MySystem
     /// 调整机具服务费工具类
     /// </summary>
     public class ChangePosFeeUtil
-    {
-        public static WebCMSEntities db = new WebCMSEntities();
-        
+    {      
 
 
 
@@ -27,6 +25,7 @@ namespace MySystem
             }
             RedisDbconn.Instance.Set("SetJKPosDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetJKPosDepositWait:" + SnIds, 10);
+            WebCMSEntities db = new WebCMSEntities();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
@@ -73,6 +72,7 @@ namespace MySystem
                 //设置押金添加记录
                 PublicFunction.MerchantDepositSet(pos.BrandId, pos.BuyUserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
+            db.Dispose();
             return "设置成功";
         }
         #endregion
@@ -90,6 +90,7 @@ namespace MySystem
             }
             RedisDbconn.Instance.Set("SetKDBPosDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetKDBPosDepositWait:" + SnIds, 10);
+            WebCMSEntities db = new WebCMSEntities();
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
             {
@@ -123,6 +124,7 @@ namespace MySystem
                 //设置押金添加记录
                 PublicFunction.MerchantDepositSet(pos.BrandId, pos.BuyUserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
+            db.Dispose();
             return "设置成功";
         }
         #endregion
@@ -140,6 +142,7 @@ namespace MySystem
             }
             RedisDbconn.Instance.Set("SetLSPosDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetLSPosDepositWait:" + SnIds, 10);
+            WebCMSEntities db = new WebCMSEntities();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
@@ -203,6 +206,7 @@ namespace MySystem
                 //设置押金添加记录
                 PublicFunction.MerchantDepositSet(pos.BrandId, pos.BuyUserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
+            db.Dispose();
             return "设置成功";
         }
         #endregion
@@ -220,6 +224,7 @@ namespace MySystem
             }
             RedisDbconn.Instance.Set("SetLISPosDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetLISPosDepositWait:" + SnIds, 10);
+            WebCMSEntities db = new WebCMSEntities();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
@@ -261,6 +266,7 @@ namespace MySystem
                 //设置押金添加记录
                 PublicFunction.MerchantDepositSet(pos.BrandId, pos.BuyUserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
+            db.Dispose();
             return "设置成功";
         }
         #endregion
@@ -278,6 +284,7 @@ namespace MySystem
             RedisDbconn.Instance.Set("SetSFTPosDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetSFTPosDepositWait:" + SnIds, 10);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
+            WebCMSEntities db = new WebCMSEntities();
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
             {
@@ -312,6 +319,7 @@ namespace MySystem
                 //设置押金添加记录
                 PublicFunction.MerchantDepositSet(pos.BrandId, pos.BuyUserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
+            db.Dispose();
             return "设置成功";
         }
         #endregion
@@ -329,6 +337,7 @@ namespace MySystem
             }
             RedisDbconn.Instance.Set("SetHKPosDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetHkPosDepositWait:" + SnIds, 10);
+            WebCMSEntities db = new WebCMSEntities();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
@@ -392,6 +401,7 @@ namespace MySystem
                 PublicFunction.MerchantDepositSet(pos.BrandId, pos.BuyUserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
 
             }
+            db.Dispose();
             return "设置成功";
         }
         #endregion
@@ -410,6 +420,7 @@ namespace MySystem
             RedisDbconn.Instance.Set("SetLDPosDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetLDPosDepositWait:" + SnIds, 10);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
+            WebCMSEntities db = new WebCMSEntities();
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
             {
@@ -443,6 +454,7 @@ namespace MySystem
                 //设置押金添加记录
                 PublicFunction.MerchantDepositSet(pos.BrandId, pos.BuyUserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
+            db.Dispose();
             return "设置成功";
         }
         #endregion
@@ -460,6 +472,7 @@ namespace MySystem
             }
             RedisDbconn.Instance.Set("SetHYFPosDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetHYFPosDepositWait:" + SnIds, 10);
+            WebCMSEntities db = new WebCMSEntities();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
@@ -498,6 +511,7 @@ namespace MySystem
                 //设置押金添加记录
                 PublicFunction.MerchantDepositSet(pos.BrandId, pos.BuyUserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
+            db.Dispose();
             return "设置成功";
         }
         #endregion
@@ -536,6 +550,7 @@ namespace MySystem
             }
             RedisDbconn.Instance.Set("SetPosPDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetPosPDepositWait:" + SnIds, 10);
+            WebCMSEntities db = new WebCMSEntities();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
@@ -556,9 +571,9 @@ namespace MySystem
                     return "机具" + pos.PosSn + "设置失败";
                 }
                 JsonData jsonObj = JsonMapper.ToObject(content);
-                if (jsonObj["resultCode"].ToString() != "1")
+                if (jsonObj["code"].ToString() != "200")
                 {
-                    return jsonObj["errorDesc"].ToString();
+                    return "设置失败";
                 }
                 var BeforeDeposit = 0;
                 if (string.IsNullOrEmpty(pos.PrizeParams))
@@ -576,6 +591,7 @@ namespace MySystem
                 //设置押金添加记录
                 PublicFunction.MerchantDepositSet(pos.BrandId, pos.BuyUserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
+            db.Dispose();
             return "设置成功";
         }
         #endregion