Эх сурвалжийг харах

增加人工补原始数据功能

lcl 4 сар өмнө
parent
commit
f7185a44f3

+ 15 - 0
Controllers/HomeController.cs

@@ -97,5 +97,20 @@ namespace MySystem.Controllers
             }
             return result;
         }
+
+        public ActionResult SourceDataToDb()
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            Dictionary<string, string> dic = db.KqProducts.Select(m => new { m.SpProductType, m.Name }).ToDictionary(m => m.SpProductType, m => m.Name);
+            db.Dispose();
+            ViewBag.dic = dic;
+            return View();
+        }
+
+        public string SourceDataToDbResult(string content)
+        {
+            RedisDbconn.Instance.AddList("DataToDbQueue", content);
+            return "ok";
+        }
     }
 }

+ 45 - 0
Views/Home/SourceDataToDb.cshtml

@@ -0,0 +1,45 @@
+@{
+    Dictionary<int, string> dic = ViewBag.dic as Dictionary<int, string>;
+}
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>补原始数据</title>
+</head>
+<body>
+    <div>
+        品牌:<select id="brand">
+            @foreach(int Id in dic.Keys)
+            {
+            <option value="@Id">@dic[Id]</option>
+            }
+        </select>
+    </div>
+    <div>
+        类型:<select id="kind">
+            <option value="bind">绑定</option>
+            <option value="trade">交易</option>
+            <option value="active">激活/押金</option>
+            <option value="merchantinfo">商户</option>
+            <option value="merchant">商户(力pos)</option>
+        </select>
+    </div>
+    <div>
+        报文:<textarea id="content" style="width: 100%; height: 300px;"></textarea>
+    </div>
+    <div>
+        <input type="button" value="查询" onclick="post()">
+    </div>
+    <script>
+        function post(){
+            var brand = document.getElementById("brand").value
+            var kind = document.getElementById("kind").value;
+            var content = document.getElementById("content").value;
+            window.location.href = "/home/SourceDataToDbResult?content=" + kind + "|" + brand + "|" + content;
+        }
+    </script>
+</body>
+</html>