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

调整后台设置机具服务费功能,添加设置记录

DuGuYang 2 лет назад
Родитель
Сommit
33aba28090
3 измененных файлов с 74 добавлено и 22 удалено
  1. BIN
      AppStart/.DS_Store
  2. 26 2
      AppStart/PublicChangePosFee.cs
  3. 48 20
      AppStart/PublicFunction.cs

BIN
AppStart/.DS_Store


+ 26 - 2
AppStart/PublicChangePosFee.cs

@@ -73,6 +73,9 @@ namespace MySystem
                 decimal amount = decimal.Parse(DepositId);
                 pos.PrizeParams = amount.ToString("f0");
                 db.SaveChanges();
+
+                //设置押金添加记录
+                PublicFunction.MerchantDepositSet(pos.BrandId, 0, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
             return "设置成功";
         }
@@ -121,6 +124,9 @@ namespace MySystem
                 decimal amount = decimal.Parse(PublicImportDataService.Instance.GetDepositAmount(DepositId));
                 pos.PrizeParams = amount.ToString("f0");
                 db.SaveChanges();
+
+                //设置押金添加记录
+                PublicFunction.MerchantDepositSet(pos.BrandId, 0, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
             return "设置成功";
         }
@@ -198,6 +204,9 @@ namespace MySystem
                 }
                 pos.PrizeParams = amount.ToString("f0");
                 db.SaveChanges();
+
+                //设置押金添加记录
+                PublicFunction.MerchantDepositSet(pos.BrandId, 0, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
             return "设置成功";
         }
@@ -253,6 +262,9 @@ namespace MySystem
                 }
                 pos.PrizeParams = DepositId;
                 db.SaveChanges();
+
+                //设置押金添加记录
+                PublicFunction.MerchantDepositSet(pos.BrandId, 0, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
             return "设置成功";
         }
@@ -263,7 +275,7 @@ namespace MySystem
         #region 盛付通-设置押金
         public static string SetSFTDeposit(string SnIds,string DepositId)
         {
-            // string DepositId = "2021POS299";
+            // string DepositId = "2024POS299";
             string check = RedisDbconn.Instance.Get<string>("SetSFTPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -298,8 +310,11 @@ namespace MySystem
                 {
                     BeforeDeposit = int.Parse(pos.PrizeParams);
                 }
-                pos.PrizeParams = DepositId.Replace("2021POS", "");
+                pos.PrizeParams = DepositId.Replace("2024POS", "");
                 db.SaveChanges();
+
+                //设置押金添加记录
+                PublicFunction.MerchantDepositSet(pos.BrandId, 0, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
             return "设置成功";
         }
@@ -378,6 +393,9 @@ namespace MySystem
                 pos.PrizeParams = amount.ToString("f0");
                 db.SaveChanges();
 
+                //设置押金添加记录
+                PublicFunction.MerchantDepositSet(pos.BrandId, 0, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
+
             }
             return "设置成功";
         }
@@ -426,6 +444,9 @@ namespace MySystem
                 decimal amount = decimal.Parse(DepositId);
                 pos.PrizeParams = amount.ToString("f0");
                 db.SaveChanges();
+
+                //设置押金添加记录
+                PublicFunction.MerchantDepositSet(pos.BrandId, 0, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
             return "设置成功";
         }
@@ -478,6 +499,9 @@ namespace MySystem
                 decimal amount = decimal.Parse(DepositId);
                 pos.PrizeParams = amount.ToString("f0");
                 db.SaveChanges();
+
+                //设置押金添加记录
+                PublicFunction.MerchantDepositSet(pos.BrandId, 0, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
             }
             return "设置成功";
         }

+ 48 - 20
AppStart/PublicFunction.cs

@@ -45,7 +45,7 @@ namespace MySystem
                                     result += rightString;
                                 }
                                 else
-                                { 
+                                {
                                     result += "{title: '基本权限', id: '" + sub3.Id + "_base'}";
                                 }
                                 result += "]},";
@@ -136,7 +136,7 @@ namespace MySystem
                                     result += rightString;
                                 }
                                 else
-                                { 
+                                {
                                     result += "{title: '基本权限', id: '" + sub3.Id + "_base'}";
                                 }
                                 result += "]},";
@@ -356,7 +356,7 @@ namespace MySystem
         private static double EARTH_RADIUS = 6378.137;
 
         #endregion
-    
+
         #region 短信条数
 
         public int SMSCount()
@@ -370,7 +370,7 @@ namespace MySystem
         #region 短信消耗
 
         public void UseSMS()
-        { 
+        {
             SystemSet check = db.SystemSet.FirstOrDefault();
             if (check != null)
             {
@@ -383,7 +383,7 @@ namespace MySystem
 
         #region 获取OSS开关
         public string GetOssStatus()
-        { 
+        {
             SystemSet set = db.SystemSet.FirstOrDefault() ?? new SystemSet();
             return set.UploadOss == 1 ? "-oss" : "";
         }
@@ -395,7 +395,7 @@ namespace MySystem
             string tag = function.MD5_16(buttonId);
             string param = RedisDbconn.Instance.Get<string>("btn:" + tag);
             if (!string.IsNullOrEmpty(param))
-            { 
+            {
                 return param;
             }
             SystemSet set = db.SystemSet.FirstOrDefault() ?? new SystemSet();
@@ -409,7 +409,7 @@ namespace MySystem
             string tag = function.MD5_16(buttonId);
             string param = RedisDbconn.Instance.Get<string>("btn:" + tag);
             if (string.IsNullOrEmpty(param))
-            { 
+            {
                 SystemSet set = db.SystemSet.FirstOrDefault() ?? new SystemSet();
                 param = "{width:" + set.UploadAutoZoomWidth + ",height:" + set.UploadAutoZoomHeight + ",quality:" + set.UploadAutoZoomQuality + "},{max_file_size:" + set.UploadMaxSize + "}";
             }
@@ -419,12 +419,12 @@ namespace MySystem
             int max_file_size = int.Parse(size["max_file_size"]) / 1024;
             string unit = "KB";
             if (max_file_size / 1024 > 0)
-            { 
+            {
                 max_file_size = max_file_size / 1024;
                 unit = "MB";
             }
             if (max_file_size / 1024 > 0)
-            { 
+            {
                 max_file_size = max_file_size / 1024;
                 unit = "GB";
             }
@@ -498,7 +498,7 @@ namespace MySystem
                 }
             }
             catch (Exception ex)
-            { 
+            {
                 function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "获取Excel文件内容异常");
             }
             return dtTable;
@@ -530,7 +530,7 @@ namespace MySystem
                     }).Entity;
                     db.SaveChanges();
                 }
-                if(Count < 0)
+                if (Count < 0)
                 {
                     MachineData.TotalMachineCount -= Math.Abs(Count);
                     MachineData.UnBindCount -= Math.Abs(Count);
@@ -551,24 +551,24 @@ namespace MySystem
         public static void ClearPosHistory(WebCMSEntities db, string PosSn)
         {
             PreSendStockDetail prepos = db.PreSendStockDetail.FirstOrDefault(m => m.SnNo == PosSn && m.Status == 1);
-            if(prepos != null)
+            if (prepos != null)
             {
                 prepos.Status = -1;
                 prepos.ApplyFlag = 0;
                 SmallStoreHouse sstore = db.SmallStoreHouse.FirstOrDefault(m => m.UserId == prepos.ToUserId);
-                if(sstore != null)
+                if (sstore != null)
                 {
                     sstore.LaveNum += 1;
                     sstore.TotalNum -= 1;
                 }
                 StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.UserId == prepos.FromStoreId);
-                if(store != null)
+                if (store != null)
                 {
                     store.LaveNum += 1;
                 }
             }
             MachineApply apply = db.MachineApply.FirstOrDefault(m => m.SwapSnExpand.Contains(PosSn));
-            if(apply != null)
+            if (apply != null)
             {
                 apply.SwapSnExpand = apply.SwapSnExpand.Replace(PosSn, PosSn.Substring(0, 3) + "d" + PosSn.Substring(4));
             }
@@ -594,13 +594,13 @@ namespace MySystem
         public static Dictionary<string, Dictionary<string, string>> OpTables = new Dictionary<string, Dictionary<string, string>>();//运营中心数据模型
 
         #endregion
-    
-    
+
+
         #region 发送分表数据
 
         public static void SplitTradeRecord(TradeRecord obj, string TradeMonth = "")
         {
-            if(string.IsNullOrEmpty(TradeMonth))
+            if (string.IsNullOrEmpty(TradeMonth))
             {
                 TradeMonth = DateTime.Now.ToString("yyyyMM");
             }
@@ -609,7 +609,7 @@ namespace MySystem
 
         public static void SplitUserAccountRecord(UserAccountRecord obj, string TradeMonth = "")
         {
-            if(string.IsNullOrEmpty(TradeMonth))
+            if (string.IsNullOrEmpty(TradeMonth))
             {
                 TradeMonth = DateTime.Now.ToString("yyyyMM");
             }
@@ -617,6 +617,34 @@ namespace MySystem
         }
 
         #endregion
-    
+
+
+        #region 设置押金添加记录公共方法
+        public static void MerchantDepositSet(int BrandId, int UserId, int SnId, string SnNo, int BeforeDeposit, decimal DepositAmount, string ReturnNote)
+        {
+            try
+            {
+                WebCMSEntities maindb = new WebCMSEntities();
+                MerchantDepositSet query = maindb.MerchantDepositSet.Add(new MerchantDepositSet()
+                {
+                    CreateDate = DateTime.Now, //创建时间
+                    Sort = BrandId,//品牌
+                    SeoTitle = BeforeDeposit.ToString(),//变更前押金
+                    DepositAmount = DepositAmount,//押金
+                    ReturnNote = ReturnNote,//返回信息
+                    SnNo = SnNo,//机具Sn
+                    UserId = UserId,//创客Id
+                }).Entity;
+                maindb.SaveChanges();
+
+            }
+            catch (Exception ex)
+            {
+
+                function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "设置押金队列异常");
+            }
+        }
+        #endregion
+
     }
 }