zhoufan лет назад: 4
Родитель
Сommit
63fe762fd5

+ 11 - 5
CallCenterApi/CallCenterApi.BLL/T_Sys_UserAccount.cs

@@ -175,15 +175,21 @@ namespace CallCenterApi.BLL
175 175
             if (dt != null)
176 176
             {
177 177
                 var ds = new DataSet();
178
-
179
-                var drs = dt.Select(strWhere, filedOrder);
180
-                if (drs.Length > 0)
178
+                if (string.IsNullOrEmpty(strWhere))
181 179
                 {
182
-                    ds.Tables.Add(drs.CopyToDataTable());
180
+                    ds.Tables.Add(dt);
183 181
                 }
184 182
                 else
185 183
                 {
186
-                    ds.Tables.Add(new DataTable());
184
+                    var drs = dt.Select(strWhere, filedOrder);
185
+                    if (drs.Length > 0)
186
+                    {
187
+                        ds.Tables.Add(drs.CopyToDataTable());
188
+                    }
189
+                    else
190
+                    {
191
+                        ds.Tables.Add(new DataTable());
192
+                    }
187 193
                 }
188 194
 
189 195
                 return ds;

+ 4 - 4
CallCenterApi/CallCenterApi.DAL/T_Call_CallRecordsLD.cs

@@ -102,7 +102,7 @@ namespace CallCenterApi.DAL
102 102
         {
103 103
 
104 104
             StringBuilder strSql = new StringBuilder();
105
-            strSql.Append("select  top 1 F_CallRLDID,F_CallRecordsID,F_IsListen,F_IsDownload,F_OptID,F_OptBy,F_OptDate from T_Call_CallRecordsLD ");
105
+            strSql.Append("select  top 1 F_CallRLDID,F_CallRecordsID,F_IsListen,F_IsDownload,F_OptID,F_OptBy,F_OptDate from T_Call_CallRecordsLD WITH(NOLOCK)");
106 106
             strSql.Append(" where F_CallRLDID=@F_CallRLDID");
107 107
             SqlParameter[] parameters = {
108 108
                     new SqlParameter("@F_CallRLDID", SqlDbType.Int,4)
@@ -183,7 +183,7 @@ namespace CallCenterApi.DAL
183 183
         {
184 184
             StringBuilder strSql = new StringBuilder();
185 185
             strSql.Append("select F_CallRLDID,F_CallRecordsID,F_IsListen,F_IsDownload,F_OptID,F_OptBy,F_OptDate ");
186
-            strSql.Append(" FROM T_Call_CallRecordsLD ");
186
+            strSql.Append(" FROM T_Call_CallRecordsLD WITH(NOLOCK)");
187 187
             if (strWhere.Trim() != "")
188 188
             {
189 189
                 strSql.Append(" where " + strWhere);
@@ -203,7 +203,7 @@ namespace CallCenterApi.DAL
203 203
                 strSql.Append(" top " + Top.ToString());
204 204
             }
205 205
             strSql.Append(" F_CallRLDID,F_CallRecordsID,F_IsListen,F_IsDownload,F_OptID,F_OptBy,F_OptDate ");
206
-            strSql.Append(" FROM T_Call_CallRecordsLD ");
206
+            strSql.Append(" FROM T_Call_CallRecordsLD WITH(NOLOCK)");
207 207
             if (strWhere.Trim() != "")
208 208
             {
209 209
                 strSql.Append(" where " + strWhere);
@@ -249,7 +249,7 @@ namespace CallCenterApi.DAL
249 249
             {
250 250
                 strSql.Append("order by T.F_CallRLDID desc");
251 251
             }
252
-            strSql.Append(")AS Row, T.*  from T_Call_CallRecordsLD T ");
252
+            strSql.Append(")AS Row, T.*  from T_Call_CallRecordsLD T WITH(NOLOCK)");
253 253
             if (!string.IsNullOrEmpty(strWhere.Trim()))
254 254
             {
255 255
                 strSql.Append(" WHERE " + strWhere);

+ 1 - 1
CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords_QC.cs

@@ -642,7 +642,7 @@ namespace CallCenterApi.DAL
642 642
         {
643 643
             StringBuilder strSql = new StringBuilder();
644 644
             strSql.Append("select * ");
645
-            strSql.Append(" FROM T_Call_CallRecords ");
645
+            strSql.Append(" FROM T_Call_CallRecords WITH(NOLOCK)");
646 646
             if (strWhere.Trim() != "")
647 647
             {
648 648
                 strSql.Append(" where " + strWhere);

+ 177 - 4
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Quality/IndexBaseController.cs

@@ -1,17 +1,190 @@
1
-using System;
1
+using CallCenter.Utility;
2
+using CallCenterApi.Interface.Controllers.Base;
3
+using System;
2 4
 using System.Collections.Generic;
5
+using System.Data;
3 6
 using System.Linq;
4 7
 using System.Web;
5 8
 using System.Web.Mvc;
6 9
 
7 10
 namespace CallCenterApi.Interface.Controllers.Quality
8 11
 {
9
-    public class IndexBaseController : Controller
12
+    [Authority]
13
+    public class IndexBaseController : BaseController
10 14
     {
11 15
         // GET: IndexBase
12
-        public ActionResult Index()
16
+
17
+        //获取指标列表
18
+        public ActionResult GetList(int categoryid, string key, int page = 1, int pagesize = 10)
19
+        {
20
+            string sql = "";
21
+            DataTable dt = new DataTable();
22
+
23
+            if (categoryid > 0)
24
+            {
25
+                //sql += " and (F_CategoryId=" + categoryid + " or F_CategoryId in (select F_CategoryId from T_QC_IndexCategory where F_ParentId=" + categoryid + " )) ";
26
+                sql += " and b.F_CategoryId=" + categoryid;
27
+            }
28
+
29
+            if (!string.IsNullOrEmpty(key))
30
+            {
31
+                sql += " and b.F_Title like '%" + key.Trim() + "%' ";
32
+            }
33
+
34
+            int recordCount = 0;
35
+            dt = BLL.PagerBLL.GetListPager(
36
+                "T_QC_IndexBase b with(nolock) left join T_QC_IndexCategory c with(nolock) on b.F_CategoryId=c.F_CategoryId",
37
+                "b.F_IndexId",
38
+                "b.*,c.F_CategoryName",
39
+                " and b.F_DeleteFlag=0 " + sql,
40
+                "ORDER BY b.F_Sort",
41
+                pagesize,
42
+                page,
43
+                true,
44
+                out recordCount);
45
+
46
+            var obj = new
47
+            {
48
+                rows = dt,
49
+                total = recordCount
50
+            };
51
+
52
+            return Content(obj.ToJson());
53
+        }
54
+
55
+        //获取指标
56
+        public ActionResult GetIndexBase(int id)
57
+        {
58
+            if (id>0)
59
+            {
60
+                BLL.T_QC_IndexBase dBLL = new BLL.T_QC_IndexBase();
61
+                Model.T_QC_IndexBase dModel = dBLL.GetModel(id);
62
+                if (dModel != null)
63
+                {
64
+                    return Success("获取指标成功", dModel);
65
+                }
66
+                else
67
+                {
68
+                    return Error("获取指标失败");
69
+                }
70
+            }
71
+            else
72
+            {
73
+                return Error("获取参数失败");
74
+            }
75
+        }
76
+
77
+        //添加指标
78
+        [HttpPost]
79
+        public ActionResult AddIndexBase(int cid, int score, int sort, string title, string remark)
13 80
         {
14
-            return View();
81
+            Model.T_QC_IndexBase dModel = new Model.T_QC_IndexBase();
82
+            
83
+            dModel.F_CategoryId = cid;
84
+            dModel.F_Sort = sort;
85
+            dModel.F_Score = score;
86
+
87
+            if (!string.IsNullOrWhiteSpace(title.Trim()))
88
+            {
89
+                dModel.F_Title = WebHelper.UrlDecode(title.Trim());
90
+            }
91
+            if (!string.IsNullOrWhiteSpace(remark.Trim()))
92
+            {
93
+                dModel.F_Remark = WebHelper.UrlDecode(remark.Trim());
94
+            }
95
+
96
+            dModel.F_CreateOn = DateTime.Now;
97
+            dModel.F_CreateBy = User.F_UserId;
98
+            dModel.F_DeleteFlag = 0;
99
+
100
+            bool b = new BLL.T_QC_IndexBase().Add(dModel) > 0;
101
+            if (b)
102
+            {
103
+                DB.DbHelperSQL.ExecuteSql("update T_QC_IndexCategory set F_Score=F_Score+" + dModel.F_Score + " where F_CategoryId =" + dModel.F_CategoryId);
104
+                return Success("添加成功");
105
+            }
106
+            else
107
+            {
108
+                return Success("添加失败");
109
+            }
110
+        }
111
+
112
+        //编辑指标
113
+        [HttpPost]
114
+        public ActionResult EditIndexBase(int id, int cid, int score, int sort, string title, string remark)
115
+        {
116
+            if (id>0)
117
+            {
118
+                BLL.T_QC_IndexBase dBLL = new BLL.T_QC_IndexBase();
119
+                Model.T_QC_IndexBase dModel = dBLL.GetModel(id);
120
+                if (dModel != null)
121
+                {
122
+                    int oldscore = dModel.F_Score.Value;
123
+                    dModel.F_CategoryId = cid;
124
+                    dModel.F_Sort = sort;
125
+                    dModel.F_Score = score;
126
+                    if (!string.IsNullOrWhiteSpace(title.Trim()))
127
+                    {
128
+                        dModel.F_Title = WebHelper.UrlDecode(title.Trim());
129
+                    }
130
+                    if (!string.IsNullOrWhiteSpace(remark.Trim()))
131
+                    {
132
+                        dModel.F_Remark = WebHelper.UrlDecode(remark.Trim());
133
+                    }
134
+                    dModel.F_ModifyBy = User.F_UserId;
135
+                    dModel.F_ModifyOn = DateTime.Now;
136
+
137
+                    bool b = dBLL.Update(dModel);
138
+                    if (b)
139
+                    {
140
+                        DB.DbHelperSQL.ExecuteSql("update T_QC_IndexCategory set F_Score=F_Score+" + dModel.F_Score + "-" + oldscore + " where F_CategoryId =" + dModel.F_CategoryId);
141
+                        return Success("编辑成功");
142
+                    }
143
+                    else
144
+                    {
145
+                        return Success("编辑失败");
146
+                    }
147
+                }
148
+                else
149
+                    return Error("获取信息失败");
150
+            }
151
+            else
152
+            {
153
+                return Error("请选择要编辑的指标");
154
+            }
155
+
156
+        }
157
+
158
+        //删除指标记录
159
+        [HttpPost]
160
+        public ActionResult DelIndexBase(int id)
161
+        {
162
+            if (id > 0)
163
+            {
164
+                BLL.T_QC_IndexBase dBLL = new BLL.T_QC_IndexBase();
165
+                Model.T_QC_IndexBase dModel = dBLL.GetModel(id);
166
+                if (dModel != null)
167
+                {
168
+                    if (dBLL.Delete(id))
169
+                    {
170
+                        DB.DbHelperSQL.ExecuteSql("update T_QC_IndexCategory set F_Score=F_Score-" + dModel.F_Score + " where F_CategoryId =" + dModel.F_CategoryId);
171
+                        return Success("删除成功");
172
+                    }
173
+                    else
174
+                    {
175
+                        return Error("删除失败");
176
+                    }
177
+                }
178
+                else
179
+                {
180
+                    return Error("获取信息失败");
181
+                }
182
+            }
183
+            else
184
+            {
185
+                return Error("请选择要删除的记录");
186
+            }
15 187
         }
188
+
16 189
     }
17 190
 }

+ 160 - 4
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Quality/IndexCategoryController.cs

@@ -1,17 +1,173 @@
1
-using System;
1
+using CallCenter.Utility;
2
+using CallCenterApi.Interface.Controllers.Base;
3
+using System;
2 4
 using System.Collections.Generic;
5
+using System.Data;
3 6
 using System.Linq;
4 7
 using System.Web;
5 8
 using System.Web.Mvc;
6 9
 
7 10
 namespace CallCenterApi.Interface.Controllers.Quality
8 11
 {
9
-    public class IndexCategoryController : Controller
12
+    [Authority]
13
+    public class IndexCategoryController : BaseController
10 14
     {
11 15
         // GET: IndexCategory
12
-        public ActionResult Index()
16
+
17
+        //获取指标分类列表
18
+        public ActionResult GetList(int page = 1, int pagesize = 10)
19
+        {
20
+            string sql = " and F_DeleteFlag=0";
21
+            int recordCount = 0;
22
+            DataTable dt = BLL.PagerBLL.GetListPager(
23
+                "T_QC_IndexCategory",
24
+                "F_CategoryId",
25
+                "*",
26
+                sql,
27
+                "ORDER BY F_CategoryId ",
28
+                pagesize,
29
+                page,
30
+                true,
31
+                out recordCount);
32
+
33
+            var obj = new
34
+            {
35
+                rows = dt,
36
+                total = recordCount
37
+            };
38
+
39
+            return Content(obj.ToJson());
40
+        }
41
+
42
+        //获取指标分类列表
43
+        public ActionResult GetAllList()
44
+        {
45
+            return Success("成功", new BLL.T_QC_IndexCategory().GetList("F_DeleteFlag=0").Tables[0]);
46
+        }
47
+
48
+        //获取指标分类
49
+        public ActionResult GetIndexCategory(int id)
50
+        {
51
+            if (id > 0)
52
+            {
53
+                BLL.T_QC_IndexCategory dBLL = new BLL.T_QC_IndexCategory();
54
+                Model.T_QC_IndexCategory dModel = dBLL.GetModel(id);
55
+                if (dModel != null)
56
+                {
57
+                    return Success("获取指标分类成功", dModel);
58
+                }
59
+                else
60
+                {
61
+                    return Error("获取指标分类失败");
62
+                }
63
+            }
64
+            else
65
+            {
66
+                return Error("获取参数失败");
67
+            }
68
+        }
69
+
70
+        //添加指标分类
71
+        public ActionResult AddIndexCategory(string categoryName, int sort, int pid=0)
13 72
         {
14
-            return View();
73
+
74
+            Model.T_QC_IndexCategory dModel = new Model.T_QC_IndexCategory();
75
+
76
+            if (!string.IsNullOrWhiteSpace(categoryName.Trim()))
77
+            {
78
+                dModel.F_CategoryName = WebHelper.UrlDecode(categoryName.Trim());
79
+            }
80
+            if (sort>0)
81
+            {
82
+                dModel.F_Sort = sort;
83
+            }
84
+            if (pid>0)
85
+            {
86
+                dModel.F_ParentId = pid;
87
+            }
88
+            dModel.F_Score = 0;
89
+            dModel.F_CreateOn = DateTime.Now;
90
+            dModel.F_CreateBy = User.F_UserId;
91
+            dModel.F_DeleteFlag = 0;
92
+
93
+            bool b = new BLL.T_QC_IndexCategory().Add(dModel) > 0;
94
+            if (b)
95
+            {
96
+                return Success("添加成功");
97
+            }
98
+            else
99
+            {
100
+                return Success("添加失败");
101
+            }
102
+        }
103
+
104
+        //编辑指标分类
105
+        public ActionResult EditIndexCategory(int id, string categoryName, int sort, int pid=0)
106
+        {
107
+            if (id > 0)
108
+            {
109
+                BLL.T_QC_IndexCategory dBLL = new BLL.T_QC_IndexCategory();
110
+                Model.T_QC_IndexCategory dModel = dBLL.GetModel(id);
111
+                if (dModel != null)
112
+                {
113
+                    if (!string.IsNullOrWhiteSpace(categoryName.Trim()))
114
+                    {
115
+                        dModel.F_CategoryName = WebHelper.UrlDecode(categoryName.Trim());
116
+                    }
117
+                    if (sort > 0)
118
+                    {
119
+                        dModel.F_Sort = sort;
120
+                    }
121
+                    if (pid > 0)
122
+                    {
123
+                        dModel.F_ParentId = pid;
124
+                    }
125
+                    bool b = dBLL.Update(dModel);
126
+                    if (b)
127
+                    {
128
+                        return Success("编辑成功");
129
+                    }
130
+                    else
131
+                    {
132
+                        return Success("编辑失败");
133
+                    }
134
+                }
135
+                else
136
+                    return Error("获取信息失败");
137
+            }
138
+            else
139
+            {
140
+                return Error("请选择要编辑的分类");
141
+            }
142
+        }
143
+
144
+        //删除指标分类记录
145
+        public ActionResult DelIndexCategory(int id)
146
+        {
147
+
148
+            if (id>0)
149
+            {
150
+                var n = DB.DbHelperSQL.GetSingle(" select count(1) from T_QC_IndexBase where F_CategoryId=" + id)?.ToString() ?? "0";
151
+                if (int.Parse(n) > 0)
152
+                {
153
+                    return Error("请先删除此分类下的指标");
154
+                }
155
+                else
156
+                {
157
+                    if (new BLL.T_QC_IndexCategory().Delete(id))
158
+                    {
159
+                        return Success("删除成功");
160
+                    }
161
+                    else
162
+                    {
163
+                        return Error("删除失败");
164
+                    }
165
+                }
166
+            }
167
+            else
168
+            {
169
+                return Error("请选择要删除的记录");
170
+            }
15 171
         }
16 172
     }
17 173
 }

+ 401 - 4
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Quality/QCManageController.cs

@@ -1,17 +1,414 @@
1
-using System;
1
+using CallCenter.Utility;
2
+using CallCenterApi.Interface.Controllers.Base;
3
+using Newtonsoft.Json.Linq;
4
+using System;
2 5
 using System.Collections.Generic;
6
+using System.Data;
3 7
 using System.Linq;
4 8
 using System.Web;
5 9
 using System.Web.Mvc;
6 10
 
7 11
 namespace CallCenterApi.Interface.Controllers.Quality
8 12
 {
9
-    public class QCManageController : Controller
13
+    [Authority]
14
+    public class QCManageController : BaseController
10 15
     {
11 16
         // GET: QCManage
12
-        public ActionResult Index()
17
+
18
+        //获取未质检列表
19
+        public ActionResult GetNoQCList(string phone, string usercode)
13 20
         {
14
-            return View();
21
+            string sql = " and CallState=1 and TalkLongTime>0 and F_QCState=0 ";
22
+            DataTable dt = new DataTable();
23
+
24
+            string callstate = HttpUtility.UrlDecode(RequestString.GetQueryString("callstate"));
25
+            string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
26
+            string actiontype = HttpUtility.UrlDecode(RequestString.GetQueryString("actiontype"));
27
+            string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
28
+            string endtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
29
+            string tasktype = HttpUtility.UrlDecode(RequestString.GetQueryString("tasktype"));
30
+            string extnumber = HttpUtility.UrlDecode(RequestString.GetQueryString("extnumber"));
31
+            string PhoneType = HttpUtility.UrlDecode(RequestString.GetQueryString("phoneType"));
32
+            int islike = RequestString.GetInt("islike", 1);
33
+
34
+            string strpageindex = RequestString.GetQueryString("page");
35
+            int pageindex = 1;
36
+            string strpagesize = RequestString.GetQueryString("pagesize");
37
+            int pagesize = 10;
38
+
39
+            if (usercode != null && usercode.Trim() != "")
40
+            {
41
+                if (usercode.IndexOf(',') > 0)
42
+                {
43
+                    sql += " and UserCode in(" + usercode + ")";
44
+                }
45
+                else
46
+                {
47
+                    sql += " and UserCode ='" + usercode + "'";
48
+                }
49
+            }
50
+            if (PhoneType != null && PhoneType.Trim() != "")
51
+            {
52
+                sql += " and PhoneType='" + PhoneType + "'";
53
+            }
54
+
55
+            if (islike > 0)
56
+            {
57
+                if (phone != null && phone.Trim() != "")
58
+                {
59
+                    sql += " and CallNumber like '%" + phone + "%'";
60
+                }
61
+            }
62
+            else
63
+            {
64
+                if (phone != null && phone.Trim() != "")
65
+                {
66
+                    sql += " and CallNumber = '" + phone + "'";
67
+                }
68
+            }
69
+
70
+            if (calltype.Trim() != "")
71
+            {
72
+                if (calltype == "3")
73
+                {
74
+                    sql += " and CallType='1'";
75
+                    sql += " and CallRecordsId in(select F_CallRecordId from T_Bus_VisitResult WITH(NOLOCK) where F_CallRecordId !='' and F_CallRecordId is not null )";
76
+                }
77
+                else
78
+                    sql += " and CallType='" + calltype + "'";
79
+            }
80
+            if (tasktype.Trim() != "")
81
+            {
82
+                if (tasktype.Trim() == "2")
83
+                {
84
+                    sql += " and TaskType='" + tasktype + "'";
85
+                }
86
+                else if (tasktype.Trim() == "0")
87
+                {
88
+                    sql += " and (TaskType is null or TaskType!='2')";
89
+                }
90
+            }
91
+            if (actiontype.Trim() != "")
92
+            {
93
+                sql += " and ActionType=" + actiontype.Trim();
94
+            }
95
+            if (starttime.Trim() != "")
96
+            {
97
+                sql += " and BeginTime>='" + starttime + "' ";
98
+            }
99
+            if (endtime.Trim() != "")
100
+            {
101
+                sql += " and BeginTime<='" + endtime + "' ";
102
+            }
103
+            if (extnumber.Trim() != "")
104
+            {
105
+                sql += " and isnull(ExtNumber,'')='" + extnumber.Trim() + "'";
106
+            }
107
+
108
+            if (strpageindex.Trim() != "")
109
+            {
110
+                pageindex = Convert.ToInt32(strpageindex);
111
+            }
112
+
113
+            if (strpagesize.Trim() != "")
114
+            {
115
+                pagesize = Convert.ToInt32(strpagesize);
116
+            }
117
+
118
+            int recordCount = 0;
119
+            dt = BLL.PagerBLL.GetListPager(
120
+                "T_Call_CallRecords WITH(NOLOCK)",
121
+                "CallRecordsId",
122
+                "*,dbo.GetUserName(UserCode) as UserName,dbo.GetDictionaryName(F_CallInType) as TypeName",
123
+                sql,
124
+                "ORDER BY CallRecordsId desc",
125
+                pagesize,
126
+                pageindex,
127
+                true,
128
+                out recordCount);
129
+
130
+            var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
131
+
132
+            foreach (DataRow dr in dt.Rows)
133
+            {
134
+                string path = dr["FilePath"] != null ? dr["FilePath"].ToString() : "";
135
+                if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
136
+                {
137
+                    var ym = config.F_ParamValue;
138
+                    if (ym.Substring(ym.Length - 1) == "/")
139
+                    {
140
+                        ym = ym.Substring(0, ym.Length - 1);
141
+                    }
142
+
143
+                    string lujing = path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
144
+                    string wlpath = ym + lujing;
145
+
146
+                    dr["FilePath"] = wlpath;
147
+                }
148
+            }
149
+
150
+            var obj = new
151
+            {
152
+                state = "success",
153
+                message = "成功",
154
+                rows = dt,
155
+                total = recordCount
156
+            };
157
+
158
+            return Content(obj.ToJson());
159
+
160
+        }
161
+
162
+        //获取已质检列表
163
+        public ActionResult GetQCList(string phone, string usercode)
164
+        {
165
+            string sql = " and CallState=1 and TalkLongTime>0 and F_QCState=1 ";
166
+            DataTable dt = new DataTable();
167
+
168
+            string callstate = HttpUtility.UrlDecode(RequestString.GetQueryString("callstate"));
169
+            string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
170
+            string actiontype = HttpUtility.UrlDecode(RequestString.GetQueryString("actiontype"));
171
+            string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
172
+            string endtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
173
+            string tasktype = HttpUtility.UrlDecode(RequestString.GetQueryString("tasktype"));
174
+            string extnumber = HttpUtility.UrlDecode(RequestString.GetQueryString("extnumber"));
175
+            string PhoneType = HttpUtility.UrlDecode(RequestString.GetQueryString("phoneType"));
176
+            int islike = RequestString.GetInt("islike", 1);
177
+
178
+            string strpageindex = RequestString.GetQueryString("page");
179
+            int pageindex = 1;
180
+            string strpagesize = RequestString.GetQueryString("pagesize");
181
+            int pagesize = 10;
182
+
183
+            if (usercode != null && usercode.Trim() != "")
184
+            {
185
+                if (usercode.IndexOf(',') > 0)
186
+                {
187
+                    sql += " and UserCode in(" + usercode + ")";
188
+                }
189
+                else
190
+                {
191
+                    sql += " and UserCode ='" + usercode + "'";
192
+                }
193
+            }
194
+            if (PhoneType != null && PhoneType.Trim() != "")
195
+            {
196
+                sql += " and PhoneType='" + PhoneType + "'";
197
+            }
198
+
199
+            if (islike > 0)
200
+            {
201
+                if (phone != null && phone.Trim() != "")
202
+                {
203
+                    sql += " and CallNumber like '%" + phone + "%'";
204
+                }
205
+            }
206
+            else
207
+            {
208
+                if (phone != null && phone.Trim() != "")
209
+                {
210
+                    sql += " and CallNumber = '" + phone + "'";
211
+                }
212
+            }
213
+
214
+            if (calltype.Trim() != "")
215
+            {
216
+                if (calltype == "3")
217
+                {
218
+                    sql += " and CallType='1'";
219
+                    sql += " and CallRecordsId in(select F_CallRecordId from T_Bus_VisitResult WITH(NOLOCK) where F_CallRecordId !='' and F_CallRecordId is not null )";
220
+                }
221
+                else
222
+                    sql += " and CallType='" + calltype + "'";
223
+            }
224
+            if (tasktype.Trim() != "")
225
+            {
226
+                if (tasktype.Trim() == "2")
227
+                {
228
+                    sql += " and TaskType='" + tasktype + "'";
229
+                }
230
+                else if (tasktype.Trim() == "0")
231
+                {
232
+                    sql += " and (TaskType is null or TaskType!='2')";
233
+                }
234
+            }
235
+            if (actiontype.Trim() != "")
236
+            {
237
+                sql += " and ActionType=" + actiontype.Trim();
238
+            }
239
+            if (starttime.Trim() != "")
240
+            {
241
+                sql += " and BeginTime>='" + starttime + "' ";
242
+            }
243
+            if (endtime.Trim() != "")
244
+            {
245
+                sql += " and BeginTime<='" + endtime + "' ";
246
+            }
247
+            if (extnumber.Trim() != "")
248
+            {
249
+                sql += " and isnull(ExtNumber,'')='" + extnumber.Trim() + "'";
250
+            }
251
+
252
+            if (strpageindex.Trim() != "")
253
+            {
254
+                pageindex = Convert.ToInt32(strpageindex);
255
+            }
256
+
257
+            if (strpagesize.Trim() != "")
258
+            {
259
+                pagesize = Convert.ToInt32(strpagesize);
260
+            }
261
+
262
+            int recordCount = 0;
263
+            dt = BLL.PagerBLL.GetListPager(
264
+                "T_Call_CallRecords WITH(NOLOCK)",
265
+                "CallRecordsId",
266
+                "*,dbo.GetUserName(UserCode) as UserName,dbo.GetDictionaryName(F_CallInType) as TypeName",
267
+                sql,
268
+                "ORDER BY CallRecordsId desc",
269
+                pagesize,
270
+                pageindex,
271
+                true,
272
+                out recordCount);
273
+
274
+            var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
275
+
276
+            foreach (DataRow dr in dt.Rows)
277
+            {
278
+                string path = dr["FilePath"] != null ? dr["FilePath"].ToString() : "";
279
+                if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
280
+                {
281
+                    var ym = config.F_ParamValue;
282
+                    if (ym.Substring(ym.Length - 1) == "/")
283
+                    {
284
+                        ym = ym.Substring(0, ym.Length - 1);
285
+                    }
286
+
287
+                    string lujing = path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
288
+                    string wlpath = ym + lujing;
289
+
290
+                    dr["FilePath"] = wlpath;
291
+                }
292
+            }
293
+
294
+            var obj = new
295
+            {
296
+                state = "success",
297
+                message = "成功",
298
+                rows = dt,
299
+                total = recordCount
300
+            };
301
+
302
+            return Content(obj.ToJson());
303
+
304
+        }
305
+
306
+        //获取质检详情
307
+        public ActionResult GetIndexList(int id)
308
+        {
309
+            DataTable dt = new BLL.T_QC_IndexCategory().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
310
+            DataTable dtindex = new BLL.T_QC_IndexBase().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
311
+            DataTable dtres = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + id + " ").Tables[0];
312
+
313
+            List<object> list = new List<object>();
314
+            int allscore = 0;
315
+            int allpf = 0;
316
+            foreach (DataRow dr in dt.Select("F_ParentId=0"))
317
+            {
318
+                string categoryid = dr["F_CategoryId"].ToString().Trim();
319
+                DataRow[] drcs = dtindex.Select("F_CategoryId=" + categoryid);
320
+
321
+                var rowspan = drcs.Count();
322
+                int csc = int.Parse(dr["F_Score"].ToString().Trim());
323
+                allscore += csc;
324
+                if (rowspan > 1)
325
+                {
326
+                    var l = new
327
+                    {
328
+                        Qcid = categoryid,
329
+                        Qcname = dr["F_CategoryName"].ToString().Trim(),
330
+                        Qcscore = csc,
331
+                        Qcpf = 0,
332
+                        TypeName="",
333
+                        Rowspan = rowspan,
334
+                        Colspan = 1
335
+                    };
336
+                    list.Add(l);
337
+                }
338
+
339
+                foreach (DataRow drc in drcs)
340
+                {
341
+                    string childid = drc["F_IndexId"].ToString().Trim();
342
+                    int sc = int.Parse(drc["F_Score"].ToString().Trim());
343
+                    var pfdr = dtres.Select("F_IndexId=" + childid);
344
+                    int pf = pfdr.Count() > 0 ? int.Parse(pfdr[0]["F_QCScore"].ToString()) : 0;
345
+                    allpf += pf;
346
+                    var l1 = new
347
+                    {
348
+                        Qcid = childid,
349
+                        Qcname = drc["F_Title"].ToString().Trim(),
350
+                        Qcscore = sc,
351
+                        Qcpf = pf,
352
+                        TypeName = rowspan == 1 ? dr["F_CategoryName"].ToString().Trim() : "",
353
+                        Rowspan = 1,
354
+                        Colspan = 1
355
+                    };
356
+                    list.Add(l1);
357
+                }
358
+            }
359
+
360
+            var lt = new
361
+            {
362
+                Qcid = "0",
363
+                Qcname = "总计",
364
+                Qcscore = allscore,
365
+                Qcpf = allpf,
366
+                TypeName = "",
367
+                Rowspan = 1,
368
+                Colspan = 2
369
+            };
370
+            list.Add(lt);
371
+
372
+            dtres.Clear();
373
+            dtres.Dispose();
374
+            dtindex.Clear();
375
+            dtindex.Dispose();
376
+            dt.Clear();
377
+            dt.Dispose();
378
+
379
+            return Success("质检加载成功", list);
380
+        }
381
+
382
+
383
+        //保存质检得分
384
+        public ActionResult SaveData(int id,string json)
385
+        {
386
+            if (id > 0)
387
+            {
388
+                int allscore = 0;
389
+                List<string> list = new List<string>();
390
+                list.Add("delete from T_QC_IndexRes where CallRecordsId=" + id);
391
+                foreach (var scoreinfo in json.ToObject<List<JObject>>())
392
+                {
393
+                    list.Add("insert into T_QC_IndexRes(CallRecordsId,F_IndexId,F_Score,F_QCScore) values(" + id + "," + scoreinfo["Id"].ToString() + "," + scoreinfo["Score"].ToString() + "," + scoreinfo["QCScore"].ToString() + ")");
394
+
395
+                    allscore += int.Parse( scoreinfo["QCScore"].ToString());
396
+                }
397
+                list.Add("update T_Call_CallRecords set F_QCState=1,F_QCScore=" + allscore+ ",F_QCUserId="+ User.F_UserId+ ",F_QCUserName='"+ User.F_UserName+ "',F_QCTime=getdate() where CallRecordsId="+ id);
398
+
399
+                if (DB.DbHelperSQL.ExecuteSqlTran(list)>0)
400
+                {
401
+                    return Success("保存成功");
402
+                }
403
+                else
404
+                {
405
+                    return Error("保存失败");
406
+                }
407
+            }
408
+            else
409
+            {
410
+                return Error("保存失败");
411
+            }
15 412
         }
16 413
     }
17 414
 }

+ 15 - 17
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

@@ -408,16 +408,16 @@ namespace CallCenterApi.Interface.Controllers
408 408
         //获取坐席列表
409 409
         public ActionResult GetSeatList()
410 410
         {
411
-            List<Model.T_Sys_UserAccount> userSeartList = sysUserAccountBll.GetModelList(" f_seatflag=1 ");
412
-            userSeartList = userSeartList.OrderBy(p => p.F_UserName.Substring(p.F_UserName.Length - 1)).ToList();
413
-            if (userSeartList.Count > 0)
414
-            {
415
-                //var userSeartList = userList.OrderBy(x => x.F_UserName  );
416
-                return Success("列表加载成功", userSeartList);
417
-            }
418
-                
419
-            else
420
-                return Error("列表加载失败");
411
+            //List<Model.T_Sys_UserAccount> userSeartList = sysUserAccountBll.GetModelList(" f_seatflag=1 ");
412
+            var drs = sysUserAccountBll.GetList("").Tables[0].Select("f_seatflag=1");
413
+            var userSeartList = from r in drs select new {
414
+                F_UserId = r["F_UserId"].ToString(),
415
+                F_UserName = r["F_UserName"].ToString(),
416
+                F_UserCode = r["F_UserCode"].ToString()
417
+            };
418
+            var result = userSeartList.OrderBy(p => p.F_UserName.Substring(p.F_UserName.Length - 1)).ToList();
419
+
420
+            return Success("列表加载成功", result);
421 421
         }
422 422
         //根据角色获取用户
423 423
         public ActionResult GetUsersList(string rolecode)
@@ -425,22 +425,20 @@ namespace CallCenterApi.Interface.Controllers
425 425
             var sql = " 1=1 ";
426 426
             if (!string.IsNullOrWhiteSpace(rolecode.Trim()))
427 427
             {
428
-                string F_RoleId = DbHelperSQL.GetSingle("select F_RoleId from T_Sys_RoleInfo where F_RoleCode='" + rolecode.Trim() + "'")?.ToString() ?? "0";
428
+                string F_RoleId = DbHelperSQL.GetSingle("select F_RoleId from T_Sys_RoleInfo with(nolock) where F_RoleCode='" + rolecode.Trim() + "'")?.ToString() ?? "0";
429 429
 
430 430
                 sql += " and F_RoleId = " + F_RoleId;
431 431
             }
432 432
 
433
-            List<Model.T_Sys_UserAccount> userList = sysUserAccountBll.GetModelList(sql, " f_userid desc ");
434
-            if (userList.Count > 0)
435
-                return Success("列表加载成功", userList);
436
-            else
437
-                return Error("列表加载失败");
433
+            //List<Model.T_Sys_UserAccount> userList = sysUserAccountBll.GetModelList(sql, " f_userid desc ");
434
+            var userList = sysUserAccountBll.GetList(sql, " f_userid desc ");
435
+            return Success("列表加载成功", userList);
438 436
         }
439 437
 
440 438
         //根据部门获取用户
441 439
         public ActionResult GetDeptUserList(int deptid = 0)
442 440
         {
443
-            List<Model.T_Sys_UserAccount> DeptUserList = sysUserAccountBll.GetModelList("F_DeptId='" + deptid + "' "," f_userid desc ");
441
+            var DeptUserList = sysUserAccountBll.GetList("F_DeptId='" + deptid + "' ", " f_userid desc ");
444 442
             return Success("列表加载成功", DeptUserList);
445 443
 
446 444
         }

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

@@ -39,7 +39,7 @@ namespace CallCenterApi.Interface.Controllers.callout
39 39
 
40 40
             var recordCount = 0;
41 41
             var dt = BLL.PagerBLL.GetListPager(
42
-                    "T_Call_OutTask",
42
+                    "T_Call_OutTask with(nolock)",
43 43
                     "F_TaskID",
44 44
                     "*",
45 45
                     " and F_DeleteFlag=0 " + sb.ToString(),
@@ -582,7 +582,7 @@ namespace CallCenterApi.Interface.Controllers.callout
582 582
             {
583 583
                 sql += " and F_Phone='" + key + "' or  F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%'";
584 584
             }
585
-            sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask where  F_IsStart=1 and F_DeleteFlag=0 " + sql + " ) ");
585
+            sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask with(nolock) where  F_IsStart=1 and F_DeleteFlag=0 " + sql + " ) ");
586 586
             #region 20180612 zhengbingbing 需要调整部分语句必须执行
587 587
             //if (!string.IsNullOrWhiteSpace(key))
588 588
             //{
@@ -592,7 +592,7 @@ namespace CallCenterApi.Interface.Controllers.callout
592 592
             int userid = User.F_UserId;
593 593
             string username = User.F_UserName;
594 594
             #region 按数量平均分配
595
-            DataTable dt = DbHelperSQL.Query("select *,NEWID() from T_Call_OutTaskTelNum where 1=1 " + sb.ToString() + "  order by NEWID()").Tables[0];
595
+            DataTable dt = DbHelperSQL.Query("select *,NEWID() from T_Call_OutTaskTelNum with(nolock) where 1=1 " + sb.ToString() + "  order by NEWID()").Tables[0];
596 596
             //otnBLL.GetList(" F_FPState=0 ").Tables[0];
597 597
             List<Model.T_Sys_UserAccount> userlist = new BLL.T_Sys_UserAccount().GetModelList(" F_SeatFlag=1 ");
598 598
             if (dt != null)
@@ -652,11 +652,11 @@ namespace CallCenterApi.Interface.Controllers.callout
652 652
             {
653 653
                 sql += " and F_Phone='" + key + "' or  F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%'";
654 654
             }
655
-            sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask where  F_IsStart=1 and F_DeleteFlag=0 "+sql+" ) ");
655
+            sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask with(nolock) where  F_IsStart=1 and F_DeleteFlag=0 " + sql+" ) ");
656 656
 
657 657
             var recordCount = 0;
658 658
             var dt = BLL.PagerBLL.GetListPager(
659
-                    "T_Call_OutTaskTelNum",
659
+                    "T_Call_OutTaskTelNum with(nolock)",
660 660
                     "F_Id",
661 661
                     "*",
662 662
                      sb.ToString(),
@@ -683,7 +683,7 @@ namespace CallCenterApi.Interface.Controllers.callout
683 683
             int deptid = User.F_DeptId;
684 684
             int recordCount = 0;
685 685
             dt = BLL.PagerBLL.GetListPager(
686
-                                    "T_Sys_UserAccount",
686
+                                    "T_Sys_UserAccount with(nolock)",
687 687
                                     "F_UserId",
688 688
                                     "*",
689 689
                                     sql,
@@ -693,7 +693,7 @@ namespace CallCenterApi.Interface.Controllers.callout
693 693
                                     true,
694 694
                                     out recordCount);
695 695
             #region 条件调整
696
-            string sqlc = " select F_UserId,COUNT(1) Count from T_Call_OutTaskTelNum where F_DeleteFlag=0 and isnull(F_HJJGName,'') not in ('正常接通','停机','空号','正常接通-不满意','不在本地居住') and F_TaskID in (select F_TaskID from T_Call_OutTask where F_IsStart=1 and F_DeleteFlag=0) group by F_UserId";
696
+            string sqlc = " select F_UserId,COUNT(1) Count from T_Call_OutTaskTelNum with(nolock) where F_DeleteFlag=0 and isnull(F_HJJGName,'') not in ('正常接通','停机','空号','正常接通-不满意','不在本地居住') and F_TaskID in (select F_TaskID from T_Call_OutTask with(nolock) where F_IsStart=1 and F_DeleteFlag=0) group by F_UserId";
697 697
             DataTable dtCount = DbHelperSQL.Query(sqlc).Tables[0];
698 698
 
699 699
             //20180607 zhengbingbing
@@ -1277,7 +1277,7 @@ namespace CallCenterApi.Interface.Controllers.callout
1277 1277
                 int recordCount = 0;
1278 1278
 
1279 1279
                 dt = BLL.PagerBLL.GetListPager(
1280
-                   "T_Call_CallRecords",
1280
+                   "T_Call_CallRecords with(nolock)",
1281 1281
                     "CallRecordsId",
1282 1282
                     "*",
1283 1283
                     sql,

+ 41 - 33
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallblackController.cs

@@ -53,49 +53,57 @@ namespace CallCenterApi.Interface.Controllers.tel
53 53
             dt = BLL.PagerBLL.GetListPager(
54 54
                 "T_Call_Blacklist",
55 55
                 "F_BlackId",
56
-                "*",
56
+                "*,dbo.GetUserNameByID(F_UserId) as F_UserName",
57 57
                 sql,
58 58
                 "ORDER BY F_BlackId desc",
59 59
                 pagesize,
60 60
                 pageindex,
61 61
                 true,
62 62
                 out recordCount);
63
-            List<Model.T_Call_Blacklist> msgList = new BLL.T_Call_Blacklist().DataTableToList(dt);
64
-            List<Model.T_Sys_UserAccount> userlist = new BLL.T_Sys_UserAccount().GetModelList("");
63
+            //List<Model.T_Call_Blacklist> msgList = new BLL.T_Call_Blacklist().DataTableToList(dt);
64
+            //List<Model.T_Sys_UserAccount> userlist = new BLL.T_Sys_UserAccount().GetModelList("");
65
+            //var obj = new
66
+            //{
67
+            //    state = "success",
68
+            //    message = "成功",
69
+            //    rows = msgList.Select(m =>
70
+            //    {
71
+            //        var sdate = ""; var edate = ""; var username = ""; var cdate = "";
72
+            //        if (m.F_SetTime != null)
73
+            //            sdate = m.F_SetTime.Value.ToString("yyyy-MM-dd");
74
+            //        if (m.F_RemoveTime != null)
75
+            //            edate = m.F_RemoveTime.Value.ToString("yyyy-MM-dd");
76
+            //        if (m.F_UserId != null)
77
+            //        {
78
+            //            Model.T_Sys_UserAccount User = userlist.Where(u => u.F_UserId == m.F_UserId.Value).FirstOrDefault();
79
+            //            if (User != null)
80
+            //                username = User.F_UserName;
81
+            //        }
82
+            //        if (m.F_CreateTime != null)
83
+            //        {
84
+            //            cdate = m.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
85
+            //        }
86
+            //        return new
87
+            //        {
88
+            //            F_BlackId = m.F_BlackId,
89
+            //            F_TelPhone = m.F_TelPhone,
90
+            //            F_BlackType = m.F_BlackType,
91
+            //            F_SetTime = sdate,
92
+            //            F_RemoveTime = edate,
93
+            //            F_Describe = m.F_Describe,
94
+            //            F_UserId = m.F_UserId,
95
+            //            F_UserName = username,
96
+            //            F_CreateTime = cdate
97
+            //        };
98
+            //    }),
99
+            //    total = recordCount
100
+            //};
101
+
65 102
             var obj = new
66 103
             {
67 104
                 state = "success",
68 105
                 message = "成功",
69
-                rows = msgList.Select(m =>
70
-                {
71
-                    var sdate = ""; var edate = ""; var username = ""; var cdate = "";
72
-                    if (m.F_SetTime != null)
73
-                        sdate = m.F_SetTime.Value.ToString("yyyy-MM-dd");
74
-                    if (m.F_RemoveTime != null)
75
-                        edate = m.F_RemoveTime.Value.ToString("yyyy-MM-dd");
76
-                    if (m.F_UserId != null)
77
-                    {
78
-                        Model.T_Sys_UserAccount User = userlist.Where(u => u.F_UserId == m.F_UserId.Value).FirstOrDefault();
79
-                        if (User != null)
80
-                            username = User.F_UserName;
81
-                    }
82
-                    if (m.F_CreateTime != null)
83
-                    {
84
-                        cdate = m.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
85
-                    }
86
-                    return new
87
-                    {
88
-                        F_BlackId = m.F_BlackId,
89
-                        F_TelPhone = m.F_TelPhone,
90
-                        F_BlackType = m.F_BlackType,
91
-                        F_SetTime = sdate,
92
-                        F_RemoveTime = edate,
93
-                        F_Describe = m.F_Describe,
94
-                        F_UserId = m.F_UserId,
95
-                        F_UserName = username,
96
-                        F_CreateTime = cdate
97
-                    };
98
-                }),
106
+                rows = dt,
99 107
                 total = recordCount
100 108
             };
101 109