zhengbingbing лет назад: 7
Родитель
Сommit
64c85f32b5

+ 9 - 1
codegit/CallCenterApi/CallCenterApi.BLL/T_Cus_CustomerBase.cs

@@ -174,7 +174,15 @@ namespace CallCenterApi.BLL
174 174
         }
175 175
         #endregion  BasicMethod
176 176
         #region  ExtensionMethod
177
-
177
+        /// <summary>
178
+        /// 20180509
179
+        /// zhengbingbing
180
+        /// 根据号码获取客户信息
181
+        /// </summary>
182
+        public Model.T_Cus_CustomerBase GetModelByTel(string tel)
183
+        {
184
+            return dal.GetModelByTel(tel);
185
+        }
178 186
         #endregion  ExtensionMethod
179 187
     }
180 188
 }

+ 22 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Cus_CustomerBase.cs

@@ -1008,7 +1008,29 @@ namespace CallCenterApi.DAL
1008 1008
         }
1009 1009
         #endregion  BasicMethod
1010 1010
         #region  ExtensionMethod
1011
+        /// <summary>
1012
+        /// 20180509
1013
+        /// zhengbingbing
1014
+        /// 根据号码获取客户信息
1015
+        /// </summary>
1016
+        public Model.T_Cus_CustomerBase GetModelByTel(string tel)
1017
+        {
1011 1018
 
1019
+            StringBuilder strSql = new StringBuilder();
1020
+            strSql.Append("select top 1 * from T_Cus_CustomerBase ");
1021
+            strSql.Append(" where  F_Telephone = '" + tel + "' or F_Mobile = '" + tel + "' order by F_CreatedOn desc");
1022
+            
1023
+            Model.T_Cus_CustomerBase model = new Model.T_Cus_CustomerBase();
1024
+            DataSet ds = DbHelperSQL.Query(strSql.ToString());
1025
+            if (ds.Tables[0].Rows.Count > 0)
1026
+            {
1027
+                return DataRowToModel(ds.Tables[0].Rows[0]);
1028
+            }
1029
+            else
1030
+            {
1031
+                return null;
1032
+            }
1033
+        }
1012 1034
         #endregion  ExtensionMethod
1013 1035
     }
1014 1036
 }

+ 2 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -248,6 +248,7 @@
248 248
     <Compile Include="Models\Common\ListBase.cs" />
249 249
     <Compile Include="Models\Dto\CallPlan.cs" />
250 250
     <Compile Include="Models\Dto\CategoryDto.cs" />
251
+    <Compile Include="Models\Dto\CustomerDto.cs" />
251 252
     <Compile Include="Models\Dto\ModuleInfoDto.cs" />
252 253
     <Compile Include="Models\Dto\OrderDto.cs" />
253 254
     <Compile Include="Models\Dto\ProductDto.cs" />
@@ -266,6 +267,7 @@
266 267
     <Compile Include="Models\Filter\FilterProduct.cs" />
267 268
     <Compile Include="Models\Input\CallPlanInput.cs" />
268 269
     <Compile Include="Models\Input\CategoryInput.cs" />
270
+    <Compile Include="Models\Input\CustomerInput.cs" />
269 271
     <Compile Include="Models\Input\DepartmentInput.cs" />
270 272
     <Compile Include="Models\Input\DictionaryInput.cs" />
271 273
     <Compile Include="Models\Input\ImportDataInput.cs" />

+ 16 - 8
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallOutPlanController.cs

@@ -782,10 +782,14 @@ namespace CallCenterApi.Interface.Controllers.callout
782 782
             {
783 783
                 sb.Append(" and F_HJJGId=" + hjjgid);
784 784
             }
785
-            if (yhfkid != 0)
786
-            {
787
-                sb.Append(" and F_YHFKId=" + yhfkid);
788
-            }
785
+            //else
786
+            //{
787
+            //    sb.Append(" and isnull(F_HJJGId,'')!=''");
788
+            //}
789
+            //if (yhfkid != 0)
790
+            //{
791
+            //    sb.Append(" and F_YHFKId=" + yhfkid);
792
+            //}
789 793
             if (!string.IsNullOrWhiteSpace(key))
790 794
             {
791 795
                 sb.Append(" and F_Phone like '%" + key.Trim() + "%'");
@@ -828,10 +832,14 @@ namespace CallCenterApi.Interface.Controllers.callout
828 832
             {
829 833
                 sb.Append(" and F_HJJGId=" + hjjgid);
830 834
             }
831
-            if (yhfkid != 0)
832
-            {
833
-                sb.Append(" and F_YHFKId=" + yhfkid);
834
-            }
835
+            //else
836
+            //{
837
+            //    sb.Append(" and isnull(F_HJJGId,'')!=''");
838
+            //}
839
+            //if (yhfkid != 0)
840
+            //{
841
+            //    sb.Append(" and F_YHFKId=" + yhfkid);
842
+            //}
835 843
             if (!string.IsNullOrWhiteSpace(key))
836 844
             {
837 845
                 sb.Append(" and F_Phone like '%" + key.Trim() + "%'");

Разница между файлами не показана из-за своего большого размера
+ 703 - 440
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs


+ 39 - 7
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -1,6 +1,7 @@
1 1
 using CallCenter.Utility;
2 2
 using CallCenterApi.Common;
3 3
 using CallCenterApi.Interface.Controllers.Base;
4
+using CallCenterApi.Interface.Models.Dto;
4 5
 using System;
5 6
 using System.Collections.Generic;
6 7
 using System.Data;
@@ -113,23 +114,54 @@ namespace CallCenterApi.Interface.Controllers.tel
113 114
         /// 根据来电号码获取客户信息
114 115
         /// </summary>
115 116
         /// <returns></returns>
116
-        public ActionResult GetCustomerByTel()
117
+        public ActionResult GetCustomerByTel(string tel)
117 118
         {
118 119
             ActionResult res = NoToken("未知错误,请重新登录");
119 120
             if (Request.IsAuthenticated)
120 121
             {
121
-                DataTable dt = new DataTable();
122
-
123
-                string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
122
+                
124 123
                 BLL.T_Cus_CustomerBase bll = new BLL.T_Cus_CustomerBase();
125
-                dt = bll.GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
126
-
127
-                res = Success("客户信息加载成功", dt);
124
+                var cusmodel=bll.GetModelByTel(tel);
125
+                CustomerDto cusdto = new CustomerDto();
126
+                if (cusmodel != null)
127
+                {
128
+                    cusdto.id = cusmodel.F_CustomerId;
129
+                    cusdto.cusname = cusmodel.F_CustomerName;
130
+                    cusdto.mobile = cusmodel.F_Mobile;
131
+                    cusdto.telphone = cusmodel.F_Telephone;
132
+                    cusdto.countryid = cusmodel.F_CityID.Value;
133
+                    cusdto.country = cusmodel.F_City;
134
+                    cusdto.address = cusmodel.F_Address;
135
+                    res = Success("获取成功", cusdto);
136
+                }
137
+                else
138
+                {
139
+                    res = Error("暂无此用户");
140
+                }
128 141
 
129 142
             }
130 143
             return res;
131 144
         }
132 145
 
146
+        #region 20180509调整前
147
+        //public ActionResult GetCustomerByTel()
148
+        //{
149
+        //    ActionResult res = NoToken("未知错误,请重新登录");
150
+        //    if (Request.IsAuthenticated)
151
+        //    {
152
+        //        DataTable dt = new DataTable();
153
+
154
+        //        string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
155
+        //        BLL.T_Cus_CustomerBase bll = new BLL.T_Cus_CustomerBase();
156
+        //        dt = bll.GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
157
+                
158
+        //        res = Success("客户信息加载成功", dt);
159
+
160
+        //    }
161
+        //    return res;
162
+        //}
163
+        #endregion
164
+
133 165
         /// <summary>
134 166
         /// 根据来电号码获取最近的callid
135 167
         /// </summary>

+ 18 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Dto/CustomerDto.cs

@@ -0,0 +1,18 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Web;
5
+
6
+namespace CallCenterApi.Interface.Models.Dto
7
+{
8
+    public class CustomerDto
9
+    {
10
+        public int id { get; set; } = 0;
11
+        public string cusname { get; set; } = "";
12
+        public string mobile { get; set; } = "";
13
+        public string telphone { get; set; } = "";
14
+        public string address { get; set; } = "";
15
+        public string country { get; set; } = "";
16
+        public int countryid { get; set; } = 0;
17
+    }
18
+}

+ 18 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/CustomerInput.cs

@@ -0,0 +1,18 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Web;
5
+
6
+namespace CallCenterApi.Interface.Models.Input
7
+{
8
+    public class CustomerInput
9
+    {
10
+        public int id { get; set; } = 0;
11
+        public string cusname { get; set; } = "";
12
+        public string mobile { get; set; } = "";
13
+        public string telphone { get; set; } = "";
14
+        public string address { get; set; } = "";
15
+        public string country { get; set; } = "";
16
+        public int countryid { get; set; } = 0;
17
+    }
18
+}