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

对接的接口 ,提交的加一些限制;不能重复提交

liyuanyuan лет назад: 4
Родитель
Сommit
5fe453654f

+ 28 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/AutoCallOutController.cs

@@ -43,11 +43,32 @@ namespace CallCenterApi.Interface.Controllers.callout
43 43
         }
44 44
         ///tianjia数据
45 45
         ///
46
+        
46 47
         public ActionResult AddInfo(string usercode, string tel, string identification)
47 48
         {
48 49
 
49 50
             Model.AutoCallOut dModel = new Model.AutoCallOut();
50 51
 
52
+            BLL.AutoCallOut bll = new BLL.AutoCallOut();
53
+            if (string.IsNullOrEmpty(identification))
54
+            {
55
+                return Error("添加失败,唯一值必填");
56
+            }
57
+            if (string.IsNullOrEmpty(usercode))
58
+            {
59
+                return Error("添加失败,usercode必填");
60
+            }
61
+            if (string.IsNullOrEmpty(tel))
62
+            {
63
+                return Error("添加失败,tel必填");
64
+            }
65
+            List<Model.AutoCallOut> list=  bll.GetModelList(" identification='" + identification.Trim() + "'");
66
+            if (list != null && list.Count > 0)
67
+            {
68
+                return Error("添加失败,唯一值存在");
69
+            }
70
+
71
+
51 72
             dModel.tel = tel.Trim();
52 73
             dModel.identification = identification.Trim();
53 74
             dModel.usercode = usercode.Trim();
@@ -97,6 +118,13 @@ namespace CallCenterApi.Interface.Controllers.callout
97 118
             string filepath = "";
98 119
             string TalkStartTime = "";
99 120
             int TalkLongTime = 0;
121
+
122
+            if (string.IsNullOrEmpty(identification))
123
+            {
124
+                return Error("获取失败,唯一值必填");
125
+            }
126
+
127
+
100 128
             string wherestr = " identification='" + identification + "'";
101 129
 
102 130
             List<Model.AutoCallOut> list = bllauto.GetModelList(wherestr);

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Model/AutoCallOut.cs

@@ -66,7 +66,7 @@ namespace CallCenterApi.Model
66 66
 			get{return _createtime;}
67 67
 		}
68 68
 		/// <summary>
69
-		/// 
69
+		/// 没拨打过是0,打过了1
70 70
 		/// </summary>
71 71
 		public int? isphoned
72 72
 		{
@@ -74,7 +74,7 @@ namespace CallCenterApi.Model
74 74
 			get{return _isphoned;}
75 75
 		}
76 76
 		/// <summary>
77
-		/// 
77
+		/// 唯一标识 
78 78
 		/// </summary>
79 79
 		public string identification
80 80
 		{