lcl 2 년 전
부모
커밋
ab865f77fe
2개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. 5 5
      Areas/Admin/Controllers/MainServer/PosMachinesFeeChangeRecordController.cs
  2. 4 4
      Startup.cs

+ 5 - 5
Areas/Admin/Controllers/MainServer/PosMachinesFeeChangeRecordController.cs

@@ -329,10 +329,11 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 JsonData dr = list[i];
                 string PosNo = dr[0].ToString(); // 机具Sn
-                var Amount = double.Parse(dr[1].ToString()); // 调整费率
-                int Kind = int.Parse(dr[2].ToString()); // 1 调升 2 调低(0.6) 3 调低(0.63)
+                var Amount = decimal.Parse(dr[1].ToString()); // 调整费率
+                int Kind = int.Parse(dr[2].ToString()); // 1 调升 2 调低(0.63) 3 调低(0.6)
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosNo) ?? new PosMachinesTwo();
-                if (pos.UpFeeFlag == 1 && pos.DownFeeFlag == 0)
+                var poschange = db.PosMachinesFeeChangeRecord.FirstOrDefault(m => m.PosId == pos.Id && m.ChangeFee == Amount) ?? new PosMachinesFeeChangeRecord();
+                if ((pos.UpFeeFlag == 1 && pos.DownFeeFlag == 0) || (pos.UpFeeFlag == 1 && pos.DownFeeFlag == 1 && poschange.Status == 0))
                 {
                     if (Kind < 2)
                     {
@@ -344,7 +345,7 @@ namespace MySystem.Areas.Admin.Controllers
                         pos.DownFeeFlag = 1;
                         pos.DownFeeDate = DateTime.Now;
                         pos.DownFeeMan = SysUserName + "_" + SysRealName;
-                        var poschange = db.PosMachinesFeeChangeRecord.FirstOrDefault(m => m.PosId == pos.Id);
+                        pos.DownFee = Amount;
                         poschange.Status = 1;
                         db.SaveChanges();
                         dnposIds.Add(pos.Id);
@@ -358,7 +359,6 @@ namespace MySystem.Areas.Admin.Controllers
                         }
                     }
                 }
-
                 else
                 {
                     warning += PosNo + ",该机具不符合调低条件,请检查好后全部重新导入";

+ 4 - 4
Startup.cs

@@ -167,10 +167,10 @@ namespace MySystem
         private void initMainServer(string Env)
         {
             string dbName = "KxsMainServer";
-            if(Env == "Production")
-            {
-                dbName = "KxsProfitServer";
-            }
+            // if(Env == "Production")
+            // {
+            //     dbName = "KxsProfitServer";
+            // }
             Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
             Library.OtherMySqlConn.connstr = Configuration["Setting:SqlConnStr"];
             System.Data.DataTable tablecollection = Library.OtherMySqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = '" + dbName + "'");