Browse Source

三房通话

duhongyu 6 years ago
parent
commit
674cb27ce1

+ 17 - 45
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/ConversationController.cs

25
         /// 获取内外线列表
25
         /// 获取内外线列表
26
         /// </summary>
26
         /// </summary>
27
         /// <returns></returns>
27
         /// <returns></returns>
28
-        public ActionResult GetList()
28
+        public ActionResult GetList(string keyword, string tel, string department, string section, string physician
29
+            , int  type=1, int pageindex = 1, int pagesize = 10)
29
         {
30
         {
30
             ActionResult res = NoToken("未知错误,请重新登录");
31
             ActionResult res = NoToken("未知错误,请重新登录");
31
             if (Request.IsAuthenticated)
32
             if (Request.IsAuthenticated)
32
             {
33
             {
33
                 string sql = " and F_IsDelete=0";
34
                 string sql = " and F_IsDelete=0";
34
                 DataTable dt = new DataTable();
35
                 DataTable dt = new DataTable();
35
-
36
-                string keyword = RequestString.GetQueryString("keyword");
37
-                //电话
38
-                string strtel = RequestString.GetQueryString("tel");
39
-                ////部门
40
-               string department = RequestString.GetQueryString("department");
41
-                ////科室
42
-                string section = RequestString.GetQueryString("section");
43
-                ////医师
44
-                string physician = RequestString.GetQueryString("physician");
45
-                string stringtype = RequestString.GetQueryString("type");
46
-                int type = 0;
47
-                string strpageindex = RequestString.GetQueryString("pageindex");
48
-                int pageindex = 1;
49
-                string strpagesize = RequestString.GetQueryString("pagesize");
50
-                int pagesize = 10;
51
-
52
-                if (keyword.Trim() != "" && keyword != "undefined")
36
+                if (!string .IsNullOrEmpty (keyword))
53
                 {
37
                 {
54
                     sql += $"  and F_Telephone like '%" + keyword.Trim() + "%' or F_Department like '%" + keyword.Trim() + "%'or F_Section like '%" + keyword.Trim() + "%'  or F_Physician like '%" + keyword.Trim() + "%' or F_Title like '%" + keyword.Trim() + "%'";
38
                     sql += $"  and F_Telephone like '%" + keyword.Trim() + "%' or F_Department like '%" + keyword.Trim() + "%'or F_Section like '%" + keyword.Trim() + "%'  or F_Physician like '%" + keyword.Trim() + "%' or F_Title like '%" + keyword.Trim() + "%'";
55
                 }
39
                 }
56
-                if (strtel.Trim() != "" && strtel != "undefined")
57
-                {
58
-                    sql += "and  F_Telephone=" + strtel;
59
-                }
60
-                if (department.Trim() != "" && department != "undefined")
61
-                {
62
-                    sql += "and  F_Department=" + department;
63
-                }
64
-                if (section.Trim() != "" && section != "undefined")
65
-                {
66
-                    sql += "and  F_Section=" + section;
67
-                }
68
-                if (physician.Trim() != "" && physician != "undefined")
40
+                if (!string.IsNullOrEmpty(tel))
69
                 {
41
                 {
70
-                    sql += "and  F_Physician=" + physician;
42
+                    sql += "and  F_Telephone='" + tel+"'";
71
                 }
43
                 }
72
-                if (strpageindex.Trim() != "")
44
+                if (!string.IsNullOrEmpty(department))
73
                 {
45
                 {
74
-                    pageindex = Convert.ToInt32(strpageindex);
46
+                    sql += "and  F_Department='" + department+"'";
75
                 }
47
                 }
76
-                if (strpagesize.Trim() != "")
48
+                if (!string.IsNullOrEmpty(section))
77
                 {
49
                 {
78
-                    pagesize = Convert.ToInt32(strpagesize);
50
+                    sql += "and  F_Section='" + section+"'";
79
                 }
51
                 }
80
-                if (stringtype .Trim() != "")
52
+                if (!string.IsNullOrEmpty(physician))
81
                 {
53
                 {
82
-                    type  = Convert.ToInt32(stringtype);
83
-                    sql += "and  F_Type=" + type;
54
+                    sql += "and  F_Physician='" + physician+"'";
84
                 }
55
                 }
56
+                sql += "and  F_Type=" + type;
85
                 int recordCount = 0;
57
                 int recordCount = 0;
86
                 dt = BLL.PagerBLL.GetListPager(
58
                 dt = BLL.PagerBLL.GetListPager(
87
                         "T_Con_Conversation",
59
                         "T_Con_Conversation",
337
                                     {
309
                                     {
338
                                         dModel.F_Physician = dr["医师"].ToString();
310
                                         dModel.F_Physician = dr["医师"].ToString();
339
                                         dModel.F_Title = dr["职称"].ToString();
311
                                         dModel.F_Title = dr["职称"].ToString();
340
-                                        var res = bll.Add(dModel);
341
-                                        if (res <= 0)
342
-                                        {
343
-                                            msg = msg + "第" + headrow + "行,导入失败<br>";
344
-                                        }
312
+                                    }
313
+                                    var res = bll.Add(dModel);
314
+                                    if (res <= 0)
315
+                                    {
316
+                                        msg = msg + "第" + headrow + "行,导入失败<br>";
345
                                     }
317
                                     }
346
                                 }
318
                                 }
347
                                 else
319
                                 else