zhangkun преди 5 години
родител
ревизия
ea2934ac7e
променени са 2 файла, в които са добавени 16 реда и са изтрити 13 реда
  1. 12 9
      代码/System.Common/Filter/ActionFilter.cs
  2. 4 4
      代码/TVShoppingCallCenter_ZLJ/Controllers/Order/OrderController.cs

+ 12 - 9
代码/System.Common/Filter/ActionFilter.cs

33
             }
33
             }
34
             catch
34
             catch
35
             {
35
             {
36
-                log.Error("ContentType:" + request.ContentType);
36
+                //log.Error("ContentType:" + request.ContentType);
37
             }
37
             }
38
             if (islog)
38
             if (islog)
39
             {
39
             {
73
             bool islog = false;
73
             bool islog = false;
74
             try
74
             try
75
             {
75
             {
76
-                if (request.Method == "GET")
77
-                {
78
-                    islog = request.Query.ContainsKey("log");
79
-                }
80
-                else
81
-                {
82
-                    islog = request.Form.ContainsKey("log");
83
-                }
76
+                if (!context.Result.ToJson().Contains("{\"state\":\"success\""))
77
+                    if (request.Method == "GET")
78
+                    {
79
+                        islog = request.Query.ContainsKey("log");
80
+                    }
81
+                    else
82
+                    {
83
+                        islog = request.Form.ContainsKey("log");
84
+                    }
85
+
86
+
84
             }
87
             }
85
             catch
88
             catch
86
             {
89
             {

+ 4 - 4
代码/TVShoppingCallCenter_ZLJ/Controllers/Order/OrderController.cs

473
 
473
 
474
             //必须属性 系统生成
474
             //必须属性 系统生成
475
             modelOrder.F_AddTime = DateTime.Now;
475
             modelOrder.F_AddTime = DateTime.Now;
476
-            modelOrder.F_AddUser = int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.PrimarySid).Value, 0);
477
-            modelOrder.F_AddUserName = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Name).Value;
476
+            modelOrder.F_AddUser =UserLogin.UserId.ObjToInt();
477
+            modelOrder.F_AddUserName = UserLogin.UserName;
478
 
478
 
479
             #endregion
479
             #endregion
480
 
480
 
554
                 int n = 1;
554
                 int n = 1;
555
                 foreach (OrderDetailInput m in input.OrderDetailList)
555
                 foreach (OrderDetailInput m in input.OrderDetailList)
556
                 {
556
                 {
557
-                    T_Bus_Product modelProduct = await bus_productRepository.GetSingle(b => b.F_ProductId == m.F_ProductId && b.F_IsSale == 1);
558
-
557
+                    T_Bus_Product modelProduct = await bus_productRepository.GetSingle(b => b.F_ProductId == m.F_ProductId);
558
+                    if (modelProduct == null) return Error("在售商品不存在");
559
                     T_Bus_OrderDetail modelDetail = new T_Bus_OrderDetail();
559
                     T_Bus_OrderDetail modelDetail = new T_Bus_OrderDetail();
560
                     modelDetail.F_ProductName = modelProduct.F_ProductName;
560
                     modelDetail.F_ProductName = modelProduct.F_ProductName;
561
                     modelDetail.F_ProductId = modelProduct.F_ProductId;
561
                     modelDetail.F_ProductId = modelProduct.F_ProductId;