Browse Source

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

liyuanyuan 4 years ago
parent
commit
5fe453654f

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

43
         }
43
         }
44
         ///tianjia数据
44
         ///tianjia数据
45
         ///
45
         ///
46
+        
46
         public ActionResult AddInfo(string usercode, string tel, string identification)
47
         public ActionResult AddInfo(string usercode, string tel, string identification)
47
         {
48
         {
48
 
49
 
49
             Model.AutoCallOut dModel = new Model.AutoCallOut();
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
             dModel.tel = tel.Trim();
72
             dModel.tel = tel.Trim();
52
             dModel.identification = identification.Trim();
73
             dModel.identification = identification.Trim();
53
             dModel.usercode = usercode.Trim();
74
             dModel.usercode = usercode.Trim();
97
             string filepath = "";
118
             string filepath = "";
98
             string TalkStartTime = "";
119
             string TalkStartTime = "";
99
             int TalkLongTime = 0;
120
             int TalkLongTime = 0;
121
+
122
+            if (string.IsNullOrEmpty(identification))
123
+            {
124
+                return Error("获取失败,唯一值必填");
125
+            }
126
+
127
+
100
             string wherestr = " identification='" + identification + "'";
128
             string wherestr = " identification='" + identification + "'";
101
 
129
 
102
             List<Model.AutoCallOut> list = bllauto.GetModelList(wherestr);
130
             List<Model.AutoCallOut> list = bllauto.GetModelList(wherestr);

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

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