lcl 1 year ago
parent
commit
c4cce2ea69

+ 3 - 2
Areas/Api/Controllers/v1/MainServer/ConsumerOrdersController.cs

@@ -264,7 +264,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             MerchantParamSet merchantset = MerchantParamSetDbconn.Instance.Get(qrcode.MerchantId) ?? new MerchantParamSet();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string OrderNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
-            ConsumerOrders query = new ConsumerOrders()
+            maindb.ConsumerOrders.Add(new ConsumerOrders()
             {
                 // Id = PublicFunction.MakeConsumerOrderId(),
                 CreateDate = DateTime.Now, //创建时间
@@ -277,7 +277,8 @@ namespace MySystem.Areas.Api.Controllers.v1
                 MaxDivi = PayMoney * merchantset.DiviPercent / 100,
                 IsAct = merchantset.IsAll == 1 ? 0u : 1u,
                 SeoDescription = Newtonsoft.Json.JsonConvert.SerializeObject(merchantset),
-            };
+            });
+            maindb.SaveChanges();
             if (PayMode == 1)
             { 
                 string backString = new AlipayFunction(_accessor.HttpContext).CreateTrade(OrderNo, merchant.Name, PayMoney.ToString("f2"), openid, SourceHost + "/api/alipay/notice", "202203BB9929042f42af4f0395c0ad8c6b056A03");

+ 0 - 217
Controllers/HomeController.cs

@@ -46,222 +46,5 @@ namespace MySystem.Controllers
             }
             return View();
         }
-
-        public string usertop()
-        {
-            List<string> MakerCodes = new List<string>();
-            MakerCodes.Add("K0000000");
-            WebCMSEntities db = new WebCMSEntities();
-            string html = "<table>";
-            List<Users> users = db.Users.Where(m => MakerCodes.Contains(m.MakerCode)).ToList();
-            foreach (Users user in users)
-            {
-                string ParentNav = function.CheckNull(user.ParentNav).Trim(',').Replace(",,", ",");
-                if (string.IsNullOrEmpty(ParentNav))
-                {
-                    ParentNav = ",1,";
-                }
-                string[] ParentNavList = ParentNav.Split(',');
-                int TopUserId = 0;
-                if (ParentNavList.Length > 1)
-                {
-                    TopUserId = int.Parse(ParentNavList[1]);
-                }
-                else
-                {
-                    TopUserId = int.Parse(ParentNavList[0]);
-                }
-                Users topUser = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
-                html += "<tr>";
-                html += "<td>" + user.MakerCode + "</td>";
-                html += "<td>" + user.RealName + "</td>";
-                html += "<td>" + topUser.MakerCode + "</td>";
-                html += "<td>" + topUser.RealName + "</td>";
-                html += "</tr>";
-            }
-            html += "</table>";
-            return html;
-        }
-
-        public string merinfo()
-        {
-            List<string> mernos = new List<string>();
-            mernos.Add("M900064131K7muih89");
-            WebCMSEntities db = new WebCMSEntities();
-            string html = "<table>";
-            List<PosMerchantInfo> mers = db.PosMerchantInfo.Where(m => mernos.Contains(m.KqMerNo)).ToList();
-            foreach (PosMerchantInfo mer in mers)
-            {
-                MachineForSnNo forSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == mer.KqSnNo) ?? new MachineForSnNo();
-                PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Status > -1 && m.Id == forSnNo.SnId) ?? new PosMachinesTwo();
-                Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
-                string ParentNav = function.CheckNull(user.ParentNav).Trim(',').Replace(",,", ",");
-                if (string.IsNullOrEmpty(ParentNav))
-                {
-                    ParentNav = ",1,";
-                }
-                string[] ParentNavList = ParentNav.Split(',');
-                int TopUserId = 0;
-                if (ParentNavList.Length > 1)
-                {
-                    TopUserId = int.Parse(ParentNavList[1]);
-                }
-                else
-                {
-                    TopUserId = int.Parse(ParentNavList[0]);
-                }
-                Users topUser = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
-                html += "<tr>";
-                html += "<td>`" + mer.KqMerNo + "</td>";
-                html += "<td>`" + pos.PosSn + "</td>";
-                html += "<td>" + user.MakerCode + "</td>";
-                html += "<td>" + user.RealName + "</td>";
-                html += "<td>" + topUser.MakerCode + "</td>";
-                html += "<td>" + topUser.RealName + "</td>";
-                html += "</tr>";
-            }
-            html += "</table>";
-            return html;
-        }
-
-        public string queryusers()
-        {
-            List<int> uids = new List<int>();
-            uids.Add(3136);
-            WebCMSEntities db = new WebCMSEntities();
-            string html = "<table>";
-            foreach (int uid in uids)
-            {
-                Users user = db.Users.FirstOrDefault(m => m.Id == uid) ?? new Users();
-                string ParentNav = user.ParentNav;
-                string MakerCode5 = "";
-                string RealName5 = "";
-                string MakerCode9 = "";
-                string RealName9 = "";
-                if (!string.IsNullOrEmpty(ParentNav))
-                {
-                    string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
-                    System.Array.Reverse(ParentNavList);
-                    foreach (string puidString in ParentNavList)
-                    {
-                        int puid = int.Parse(puidString);
-                        Users puser = db.Users.FirstOrDefault(m => m.Id == puid) ?? new Users();
-                        if (puser.UserLevel == 5 && string.IsNullOrEmpty(MakerCode5))
-                        {
-                            MakerCode5 = puser.MakerCode;
-                            RealName5 = puser.RealName;
-                        }
-                        else if (puser.UserLevel == 9 && string.IsNullOrEmpty(MakerCode9))
-                        {
-                            MakerCode9 = puser.MakerCode;
-                            RealName9 = puser.RealName;
-                            break;
-                        }
-                    }
-                }
-                html += "<tr>";
-                html += "<td>" + uid + "</td>";
-                html += "<td>" + MakerCode5 + "</td>";
-                html += "<td>" + RealName5 + "</td>";
-                html += "<td>" + MakerCode9 + "</td>";
-                html += "<td>" + RealName9 + "</td>";
-                html += "</tr>";
-            }
-            html += "</table>";
-            db.Dispose();
-            return html;
-        }
-
-        public string test(int m, int b)
-        {
-            return PublicImportDataService.Instance.QueryActiveForBrandHK(m, b);
-        }
-    
-    
-
-
-        public string setjkfee()
-        {
-            List<string> posList = new List<string>();
-            posList.Add("M700046861MmMvOOv2,00003102722201179809510");
-            string content = "";
-            foreach(string data in posList)
-            {
-                string[] datalist = data.Split(',');
-                content += function.GetWebRequest("http://connect.kexiaoshuang.com/home/setfee?merNo=" + datalist[0] + "&sn=" + datalist[1] + "&fee=0.60") + "\r\n\r\n";
-            }
-            return content;
-        }
-        public string setlsdeposit()
-        {
-            string result = "";
-            List<string> PosSnList = new List<string>();
-            PosSnList.Add("000006026215741687,4");
-            foreach(string PosItem in PosSnList)
-            {
-                string[] PosItemList = PosItem.Split(',');
-                string PosSn = PosItemList[0];
-                int BrandId = int.Parse(PosItemList[1]);
-                result += PosSn +"\n";
-                string NewId = "709820390742437888", OldId = "";
-                string content = PublicImportDataService.Instance.QueryActiveForConfig(PosSn, BrandId);
-                JsonData jsonObj = JsonMapper.ToObject(content);
-                if (jsonObj["code"].ToString() == "0")
-                {
-                    OldId = jsonObj["data"]["posMarket"]["id"].ToString();
-                }
-                jsonObj = JsonMapper.ToObject(content);
-                content = PublicImportDataService.Instance.SetDepositForLS(PosSn, OldId, NewId, BrandId);
-                result += content +"\n\n";
-            }
-            return result;
-        }
-
-        public string setlisdeposit()
-        {
-            string result = "";
-            List<string> PosSnList = new List<string>();
-            PosSnList.Add("N6220Y02012227");
-            foreach(string PosSn in PosSnList)
-            {
-                result += PosSn +"\n";
-                string content = PublicImportDataService.Instance.SetLiSDeposit(PosSn, 249);
-                result += content +"\n\n";
-            }
-            return result;
-        }
-
-        public string setkdbdeposit()
-        {
-            string result = "";
-            List<string> PosSnList = new List<string>();
-            PosSnList.Add("00005002681889126256");
-            foreach(string PosSn in PosSnList)
-            {
-                result += PosSn +"\n";
-                string content = PublicImportDataService.Instance.ModifyDeposit(PosSn, "473");
-                result += content +"\n\n";
-            }
-            return result;
-        }
-
-        public string setkdbfee()
-        {
-            string PosSn = "00005002681889119261";
-            string content = PublicImportDataService.Instance.ModifyFee(PosSn, "0.0063");
-            // {"orderNo":22509}
-            // string content = PublicImportDataService.Instance.QueryFee("22509");
-            // {"posSn":"00005702231071300130","type":"贷记卡刷卡","rate":0.0063000,"d0Fee":0.00,"status":"HANDLE_STATUS_COMPLETE"}
-            return content;
-        }
-
-        public string setlsfee()
-        {
-            // string content = PublicImportDataService.Instance.QueryFeeTmpForBrand("100", "300", 4);
-            // string content = PublicImportDataService.Instance.QueryFeeForBrand("000006026215739921", 4);
-            // string content = PublicImportDataService.Instance.SetFeeForBrand("000006026215739921", "712391426860134400", "712391668250718208", "696339175297294336", 4);
-            string content = PublicImportDataService.Instance.LDServiceFee("0000320226624650381480", 0, 10);
-            return content;
-        }
     }
 }