yuqian лет назад: 8
Родитель
Сommit
f6593b6737
19 измененных файлов с 326 добавлено и 116 удалено
  1. 22 0
      CallCenterApi/CallCenterApi.BLL/T_Call_Answers.cs
  2. 2 1
      CallCenterApi/CallCenterApi.BLL/T_Call_BanCallOut.cs
  3. 27 1
      CallCenterApi/CallCenterApi.DAL/T_Call_Answers.cs
  4. 9 5
      CallCenterApi/CallCenterApi.DAL/T_Call_BanCallOut.cs
  5. 9 8
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DictionaryController.cs
  6. 1 1
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs
  7. 7 3
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/BanCallOutController.cs
  8. 129 7
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallPlanController.cs
  9. 16 2
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/quality/QCManageController.cs
  10. 1 1
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/TalkTimeController.cs
  11. 2 2
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/TotalCallController.cs
  12. 1 1
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/YearContrastController.cs
  13. 14 3
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiWorkTotalController.cs
  14. 79 74
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs
  15. 3 3
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs
  16. 0 1
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Filter/FilterBanCallOut.cs
  17. 1 1
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/BanCallOutInput.cs
  18. 2 2
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/DictionaryInput.cs
  19. 1 0
      CallCenterApi/CallCenterApi.Model/T_Call_BanCallOut.cs

+ 22 - 0
CallCenterApi/CallCenterApi.BLL/T_Call_Answers.cs

@@ -108,6 +108,28 @@ namespace CallCenterApi.BLL
108 108
         /// <summary>
109 109
         /// 获得数据列表
110 110
         /// </summary>
111
+        public List<CallCenterApi.Model.T_Call_Answers> DataTableToListDTO(DataTable dt)
112
+        {
113
+            List<CallCenterApi.Model.T_Call_Answers> modelList = new List<CallCenterApi.Model.T_Call_Answers>();
114
+            int rowsCount = dt.Rows.Count;
115
+            if (rowsCount > 0)
116
+            {
117
+                CallCenterApi.Model.T_Call_Answers model;
118
+                for (int n = 0; n < rowsCount; n++)
119
+                {
120
+                    model = dal.DataRowToModelDTO(dt.Rows[n]);
121
+                    if (model != null)
122
+                    {
123
+                        modelList.Add(model);
124
+                    }
125
+                }
126
+            }
127
+            return modelList;
128
+        }
129
+
130
+        /// <summary>
131
+        /// 获得数据列表
132
+        /// </summary>
111 133
         public DataSet GetAllList()
112 134
         {
113 135
             return GetList("");

+ 2 - 1
CallCenterApi/CallCenterApi.BLL/T_Call_BanCallOut.cs

@@ -26,7 +26,8 @@ namespace CallCenterApi.BLL
26 26
                     model = new CallCenterApi.Model.T_Call_BanCallOut();
27 27
                     model.Id = Convert.ToInt32(dt.Rows[n]["F_Id"]);
28 28
                     model.F_Phone = dt.Rows[n]["F_Phone"] == null ? "" : dt.Rows[n]["F_Phone"].ToString();
29
-                    model.F_SetTime = dt.Rows[n]["F_SetTime"] == null ? null : (DateTime?)Convert.ToDateTime(dt.Rows[n]["F_Phone"].ToString());
29
+                    model.F_SetTime = dt.Rows[n]["F_SetTime"] == null ? null : (DateTime?)Convert.ToDateTime(dt.Rows[n]["F_SetTime"].ToString());
30
+                    model.F_Remark = dt.Rows[n]["F_Remark"] == DBNull.Value ? "" : dt.Rows[n]["F_Remark"].ToString();
30 31
                     modelList.Add(model);
31 32
                 }
32 33
             }

+ 27 - 1
CallCenterApi/CallCenterApi.DAL/T_Call_Answers.cs

@@ -148,7 +148,7 @@ namespace CallCenterApi.DAL
148 148
                 return false;
149 149
             }
150 150
         }
151
-        public bool DeleteByTelid(int F_CusTelID,int F_TaskID)
151
+        public bool DeleteByTelid(int F_CusTelID, int F_TaskID)
152 152
         {
153 153
             StringBuilder strSql = new StringBuilder();
154 154
             strSql.Append("delete from T_Call_Answers ");
@@ -283,6 +283,32 @@ namespace CallCenterApi.DAL
283 283
         }
284 284
 
285 285
         /// <summary>
286
+        /// 得到一个对象实体
287
+        /// </summary>
288
+        public CallCenterApi.Model.T_Call_Answers DataRowToModelDTO(DataRow row)
289
+        {
290
+            CallCenterApi.Model.T_Call_Answers model = new CallCenterApi.Model.T_Call_Answers();
291
+            if (row != null)
292
+            {
293
+
294
+                if (row["F_Answer"] != null)
295
+                {
296
+                    model.F_Answer = row["F_Answer"].ToString();
297
+                }
298
+                if (row["F_CusTelID"] != null && row["F_CusTelID"].ToString() != "")
299
+                {
300
+                    model.F_CusTelID = int.Parse(row["F_CusTelID"].ToString());
301
+                }
302
+                if (row["F_QID"] != null && row["F_QID"].ToString() != "")
303
+                {
304
+                    model.F_QID = int.Parse(row["F_QID"].ToString());
305
+                }
306
+                
307
+            }
308
+            return model;
309
+        }
310
+
311
+        /// <summary>
286 312
         /// 获得数据列表
287 313
         /// </summary>
288 314
         public DataSet GetList(string strWhere)

+ 9 - 5
CallCenterApi/CallCenterApi.DAL/T_Call_BanCallOut.cs

@@ -13,26 +13,30 @@ namespace CallCenterApi.DAL
13 13
     {
14 14
         public int Add(Model.T_Call_BanCallOut model)
15 15
         {
16
-            var sql = "insert into T_Call_BanCallOut (F_Phone) values (@F_Phone)";
17
-            return DbHelperSQL.ExecuteSql(sql, new SqlParameter("@F_Phone", model.F_Phone));
16
+            var sql = "insert into T_Call_BanCallOut (F_Phone,F_Remark) values (@F_Phone,@F_Remark)";
17
+            return DbHelperSQL.ExecuteSql(sql, new SqlParameter[] {
18
+                new SqlParameter("@F_Phone", model.F_Phone),
19
+                new SqlParameter("@F_Remark", model.F_Remark)
20
+            });
18 21
         }
19 22
 
20 23
         public int DeleteBatch(string ids)
21 24
         {
22
-            var sql = $"delete form T_Call_BanCallOut where F_Id in ({ids}) ";
25
+            var sql = $"delete from T_Call_BanCallOut where F_Id in ({ids}) ";
23 26
             return DbHelperSQL.ExecuteSql(sql);
24 27
         }
25 28
 
26 29
         public Model.T_Call_BanCallOut GetModel(string phone)
27 30
         {
28 31
             Model.T_Call_BanCallOut model = new Model.T_Call_BanCallOut();
29
-            var sql = "select F_Id,F_Phone,F_SetTime from T_Call_BanCallOut WHERE F_Phone=@F_Phone";
30
-            var dt = DbHelperSQL.Query(sql, new SqlParameter("@F_Phone", phone)).Tables[0];
32
+            var sql = "select F_Id,F_Phone,F_SetTime,F_Remark from T_Call_BanCallOut WHERE F_Phone=@F_Phone";
33
+            var dt = DbHelperSQL.Query(sql, new SqlParameter("@F_Phone", model.F_Phone)).Tables[0];
31 34
             if (dt.Rows.Count > 0)
32 35
             {
33 36
                 model.Id = dt.Rows[0]["F_Id"] == DBNull.Value ? 0 : Convert.ToInt32(dt.Rows[0]["F_Id"]);
34 37
                 model.F_Phone = dt.Rows[0]["F_Phone"] == DBNull.Value ? "" : dt.Rows[0]["F_Phone"].ToString();
35 38
                 model.F_SetTime = dt.Rows[0]["F_SetTime"] == DBNull.Value ? null : (DateTime?)Convert.ToDateTime(dt.Rows[0]["F_Phone"].ToString());
39
+                model.F_Remark = dt.Rows[0]["F_Remark"] == DBNull.Value ? "" : dt.Rows[0]["F_Remark"].ToString();
36 40
                 return model;
37 41
             }
38 42
             return null;

+ 9 - 8
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DictionaryController.cs

@@ -12,7 +12,7 @@ using System.Web.Mvc;
12 12
 
13 13
 namespace CallCenterApi.Interface.Controllers
14 14
 {
15
-    
15
+
16 16
     public class DictionaryController : BaseController
17 17
     {
18 18
         private BLL.T_Sys_DictionaryBase dictionaryBaseBLL = new BLL.T_Sys_DictionaryBase();
@@ -93,10 +93,12 @@ namespace CallCenterApi.Interface.Controllers
93 93
             {
94 94
                 Model.T_Sys_DictionaryBase orderModel = new Model.T_Sys_DictionaryBase();
95 95
                 BLL.T_Sys_DictionaryBase orderBll = new BLL.T_Sys_DictionaryBase();
96
-
96
+                Model.T_Sys_DictionaryBase model = orderBll.GetModel(input.DicFlag);
97
+                if (model != null)
98
+                    return Error("字典对象已存在");
97 99
                 orderModel.F_DictionaryFlag = input.DicFlag;
98
-                orderModel.F_DictionaryName = input.Name;
99
-                orderModel.F_Describe = input.Remark;
100
+                orderModel.F_DictionaryName = input.DicName;
101
+                orderModel.F_Describe = input.DicRemark;
100 102
                 orderModel.F_State = true;
101 103
                 orderModel.F_Sort = input.Sort;
102 104
 
@@ -123,9 +125,8 @@ namespace CallCenterApi.Interface.Controllers
123 125
                 Model.T_Sys_DictionaryBase orderModel = orderBll.GetModel(input.DicFlag);
124 126
                 if (orderModel == null)
125 127
                     return Error("字典对象不存在");
126
-                orderModel.F_DictionaryFlag = input.DicFlag;
127
-                orderModel.F_DictionaryName = input.Name;
128
-                orderModel.F_Describe = input.Remark;
128
+                orderModel.F_DictionaryName = input.DicName;
129
+                orderModel.F_Describe = input.DicRemark;
129 130
                 orderModel.F_Sort = input.Sort;
130 131
                 if (orderBll.Update(orderModel))
131 132
                     res = Success("字典添加成功");
@@ -167,7 +168,7 @@ namespace CallCenterApi.Interface.Controllers
167 168
         //获取字典值列表
168 169
         public ActionResult GetDicValueList(FilterDictionary filter)
169 170
         {
170
-             ActionResult res = NoToken("未知错误,请重新登录");
171
+            ActionResult res = NoToken("未知错误,请重新登录");
171 172
             if (Request.IsAuthenticated)
172 173
             {
173 174
                 string sql = "";

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

@@ -176,7 +176,7 @@ namespace CallCenterApi.Interface.Controllers
176 176
                 //    return Error("密码必须为6-16个字符,大、小写字母和数字的组合");
177 177
 
178 178
 
179
-                var model = sysUserAccountBll.GetModel(int.Parse(input.Usercode));
179
+                var model = sysUserAccountBll.GetModel(input.Usercode);
180 180
                 if (model != null)
181 181
                     return Error("当前员工工号存在,请更换!");
182 182
 

+ 7 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/BanCallOutController.cs

@@ -31,7 +31,7 @@ namespace CallCenterApi.Interface.Controllers.callout
31 31
                              "F_Id",
32 32
                              "*",
33 33
                              sb.ToString(),
34
-                             "ORDER BY SetTime desc",
34
+                             "ORDER BY F_ID desc",
35 35
                              filter.PageSize,
36 36
                              filter.PageIndex,
37 37
                              true,
@@ -47,11 +47,15 @@ namespace CallCenterApi.Interface.Controllers.callout
47 47
 
48 48
         public ActionResult Add(BanCallOutInput input)
49 49
         {
50
-            if (!string.IsNullOrWhiteSpace(input.Phone))
50
+            if (string.IsNullOrWhiteSpace(input.Phone))
51 51
                 return Error("号码不可为空");
52
+            var model = banCallOutBLL.GetModel(input.Phone);
53
+            if (model != null)
54
+                return Error("该号码已被限制外呼");
52 55
             if (banCallOutBLL.Add(new Model.T_Call_BanCallOut()
53 56
             {
54
-                F_Phone = input.Phone
57
+                F_Phone = input.Phone,
58
+                F_Remark = input.Remark
55 59
             }) > 0)
56 60
                 return Success("添加成功");
57 61
             return Error("添加失败");

+ 129 - 7
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallPlanController.cs

@@ -53,15 +53,15 @@ namespace CallCenterApi.Interface.Controllers.callout
53 53
 
54 54
             var roleid = CurrentUser.UserData.F_RoleId;
55 55
             var deptid = CurrentUser.UserData.F_DeptId;
56
-            var deptcode = CurrentUser.UserData.F_DeptCode;
56
+            var deptCode = CurrentUser.UserData.F_DeptCode;
57 57
             var usercode = CurrentUser.UserData.F_UserCode;
58 58
             if (roleid != 0)
59 59
             {
60 60
                 if (roleid != 17)
61 61
                 {
62
-                    if (deptcode.IndexOf("|1|") > 0)
62
+                    if (deptCode.Replace("|0|1|", "").Length > 0)
63 63
                     {
64
-                        sql += " and DeptId in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptcode + "%') ";
64
+                        sql += " and DeptId in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptCode + "%') ";
65 65
                     }
66 66
                 }
67 67
             }
@@ -602,7 +602,7 @@ namespace CallCenterApi.Interface.Controllers.callout
602 602
 
603 603
             var recordCount = 0;
604 604
             var dt = BLL.PagerBLL.GetListPager(
605
-                             " T_Call_TaskTelNum tn left join T_CTI_Task t on t.TaskID=tn.F_TaskId ",
605
+                             " T_Call_TaskTelNum tn left join T_CTI_Task t on t.TaskID=tn.F_TaskId left join T_Call_CallRecords c on c.TaskType=9 and c.TaskPhoneID=tn.F_Id and c.TaskID=tn.F_TaskId ",
606 606
                              " F_Id ",
607 607
                              field,
608 608
                              " and F_TaskId=" + filter.Id + sql,
@@ -659,6 +659,9 @@ namespace CallCenterApi.Interface.Controllers.callout
659 659
                 case 2://我的任务结果
660 660
                     sql += $" and F_HCState=1 ";
661 661
                     break;
662
+                case 3://任务结果数据
663
+
664
+                    break;
662 665
                 default:
663 666
                     break;
664 667
             }
@@ -721,6 +724,123 @@ namespace CallCenterApi.Interface.Controllers.callout
721 724
             };
722 725
             return Content(obj.ToJson());
723 726
         }
727
+
728
+        public ActionResult GetPhoneResult(FilterCallPhone filter)
729
+        {
730
+            var headList1 = new List<string>() { "序号", "外呼计划", "号码Id", "号码", "分配坐席", "呼叫状态", "接通状态", "呼叫结果", "结果反馈", "导入时间", "呼出时间" };
731
+            //根据任务id查问卷
732
+            var task = taskBLL.GetModel(filter.Id);
733
+            if (task == null)
734
+                return Error("该任务不存在");
735
+            var headDt = DbHelperSQL.Query($"select Q.F_TITLE from T_Ask_Question Q  LEFT JOIN T_Ask_PagerItems PIT ON PIT.F_QuestionId = Q.F_QuestionId LEFT JOIN T_Ask_PagerInfo PIN ON PIN.F_PagerId = PIT.F_PagerId LEFT JOIN T_CTI_Task T ON T.y_TkModelId = PIN.F_PagerId where T.TaskID ={task.TaskID} ORDER BY Q.F_SortModel").Tables[0];
736
+            var headList2 = new List<string>();
737
+            foreach (DataRow row in headDt.Rows)
738
+            {
739
+                headList2.Add(row["F_TITLE"]?.ToString() ?? "");
740
+            }
741
+
742
+            var headList = new List<string>();
743
+            headList.AddRange(headList1);
744
+            headList.AddRange(headList2);
745
+
746
+
747
+            //查询数据
748
+            var sql = "";
749
+            if (filter.Id > 0)
750
+            {
751
+                var model = taskBLL.GetModel(filter.Id);
752
+                sql += " and F_TaskId=" + filter.Id;
753
+                if (model == null)
754
+                    return Error("外呼任务不存在");
755
+            }
756
+            if (!string.IsNullOrWhiteSpace(filter.Phone))
757
+            {
758
+                sql += $" and F_Phone like '%{filter.Phone}%'";
759
+            }
760
+            if (filter.FPState > -1)
761
+            {
762
+                sql += $" and F_FPState={filter.FPState} ";
763
+            }
764
+            if (filter.HCState > -1)
765
+            {
766
+                sql += $" and F_HCState={filter.HCState} ";
767
+            }
768
+            if (filter.YJState > -1)
769
+            {
770
+                sql += $" and F_YJState={filter.YJState} ";
771
+            }
772
+            if (filter.YHFKID > -1)
773
+            {
774
+                sql += $" and F_YHFKID={filter.YHFKID} ";
775
+            }
776
+            if (filter.HJJGID > -1)
777
+            {
778
+                sql += $" and F_HJJGID={filter.HJJGID} ";
779
+            }
780
+            var field = "F_Id,t.TaskName,F_Phone,F_FPState,F_HCState,F_YJState,F_Username,tn.F_CreateTime,F_HJJGName,F_YHFKName";
781
+            var recordCount = 0;
782
+            var dt = BLL.PagerBLL.GetListPager(
783
+                             " T_Call_TaskTelNum tn left join T_CTI_Task t on t.TaskID=tn.F_TaskId",
784
+                             " F_Id ",
785
+                             field,
786
+                              sql,
787
+                             "ORDER BY F_LastCallTime desc,F_ID DESC ",
788
+                             filter.PageSize,
789
+                             filter.PageIndex,
790
+                             true,
791
+                             out recordCount);
792
+            List<Model.T_Call_TaskTelNum> modelList = new BLL.T_Call_TaskTelNum().DataTableToListForShow(dt);
793
+
794
+            List<Model.T_Call_Answers> answerList = new List<T_Call_Answers>();
795
+            if (modelList.Count > 0)
796
+            {
797
+                answerList = ansBLL.DataTableToListDTO(DbHelperSQL.Query($" select A.F_QID, A.F_CusTelID, A.F_Answer from T_Call_Answers A LEFT JOIN T_Ask_Question Q ON Q.F_QuestionId=A.F_QID where F_TaskID={ task.TaskID} AND F_CusTelID in ({ string.Join(", ", string.Join(", ", modelList.Select(x => x.F_Id).ToArray()))}) ORDER BY Q.F_SortModel  ").Tables[0]);
798
+            }
799
+
800
+            var numList = modelList.Select(x => new
801
+            {
802
+                id = x.F_Id.ToString(),
803
+                taskname = x.TaskName,
804
+                phone = x.F_Phone,
805
+                agent = string.IsNullOrWhiteSpace(x.F_UserName) ? "" : x.F_UserName,
806
+                isallot = x.F_FPState == null ? "" : (x.F_FPState > 0 ? "已分配" : "未分配"),
807
+                iscalled = x.F_HCState > 0 ? "已呼叫" : "未呼叫",
808
+                isconnected = x.F_YJState > 0 ? "已接通" : "未接通",
809
+                hjjg = x.F_HJJGName,
810
+                yhfk = x.F_YHFKName,
811
+                createtime = Convert.ToDateTime(x.F_CreateTime).ToString("yyyy-MM-dd HH:mm:ss"),
812
+                lastcalltime = x.F_LastCallTime == null ? "" : Convert.ToDateTime(x.F_LastCallTime).ToString("yyyy-MM-dd HH:mm:ss")
813
+            });
814
+
815
+
816
+            var dataList = new List<List<string>>();
817
+
818
+            foreach (var item in numList)
819
+            {
820
+                var answer = answerList.Where(x => (x.F_CusTelID?.ToString() ?? "") == item.id).GroupBy(x => x.F_QID).ToList();
821
+                var itemList = new List<string>();
822
+                itemList.AddRange(new string[] { item.id, item.taskname, item.phone, item.agent, item.isallot, item.iscalled, item.isconnected, item.hjjg, item.yhfk, item.createtime, item.lastcalltime });
823
+                foreach (var i in answer)
824
+                {
825
+                    itemList.Add(string.Join(", ", i.Where(x => !string.IsNullOrWhiteSpace(x.F_Answer)).Select(x => x.F_Answer).Distinct()));
826
+                }
827
+                dataList.Add(itemList);
828
+            }
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+            return Success("获取成功", new
837
+            {
838
+                headlist = headList,
839
+                datalist = dataList
840
+            });
841
+        }
842
+
843
+
724 844
         /// <summary>
725 845
         /// 坐席自主获取号码(点击外呼分配号码)
726 846
         /// </summary>
@@ -771,16 +891,16 @@ namespace CallCenterApi.Interface.Controllers.callout
771 891
         {
772 892
             var roleid = CurrentUser.UserData.F_RoleId;
773 893
             var deptid = CurrentUser.UserData.F_DeptId;
774
-            var deptcode = CurrentUser.UserData.F_DeptCode;
894
+            var deptCode = CurrentUser.UserData.F_DeptCode;
775 895
             var usercode = CurrentUser.UserData.F_UserCode;
776 896
             var sql = "";
777 897
             if (roleid != 0)
778 898
             {
779 899
                 if (roleid != 17)
780 900
                 {
781
-                    if (deptcode.IndexOf("|1|") > 0)
901
+                    if (deptCode.Replace("|0|1|", "").Length > 0)
782 902
                     {
783
-                        sql += " and DeptId in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptcode + "%') ";
903
+                        sql += " and DeptId in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptCode + "%') ";
784 904
                     }
785 905
                 }
786 906
             }
@@ -1029,6 +1149,8 @@ namespace CallCenterApi.Interface.Controllers.callout
1029 1149
             }
1030 1150
             return Error("获取详情失败");
1031 1151
         }
1152
+
1153
+
1032 1154
         #endregion
1033 1155
 
1034 1156
         #region 导入导出号码

+ 16 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/quality/QCManageController.cs

@@ -41,7 +41,7 @@ namespace CallCenterApi.Interface.Controllers.quality
41 41
             {
42 42
                 if (roleId != 17)
43 43
                 {
44
-                    if (deptCode.IndexOf("|1|") > 0)
44
+                    if (deptCode.Replace("|0|1|", "").Length > 0)
45 45
                     {
46 46
                         if (roleId == 36 || roleId == 38 || roleId == 40)
47 47
                         {
@@ -53,6 +53,13 @@ namespace CallCenterApi.Interface.Controllers.quality
53 53
                         }
54 54
 
55 55
                     }
56
+                    else
57
+                    {
58
+                        if (roleId != 53 && roleId != 54)
59
+                        {
60
+                            sql += $" and  UserCode  in (SELECT F_UserCode FROM T_Sys_UserAccount WHERE F_DeptId={deptId})";
61
+                        }
62
+                    }
56 63
                 }
57 64
             }
58 65
 
@@ -195,7 +202,7 @@ namespace CallCenterApi.Interface.Controllers.quality
195 202
             {
196 203
                 if (roleId != 17)
197 204
                 {
198
-                    if (deptCode.IndexOf("|1|") > 0)
205
+                    if (deptCode.Replace("|0|1|", "").Length > 0)
199 206
                     {
200 207
                         if (roleId == 36 || roleId == 38 || roleId == 40)
201 208
                         {
@@ -207,6 +214,13 @@ namespace CallCenterApi.Interface.Controllers.quality
207 214
                         }
208 215
 
209 216
                     }
217
+                    else
218
+                    {
219
+                        if (roleId != 53 && roleId != 54)
220
+                        {
221
+                            sql += $" and  UserCode  in (SELECT F_UserCode FROM T_Sys_UserAccount WHERE F_DeptId={deptId})";
222
+                        }
223
+                    }
210 224
                 }
211 225
             }
212 226
 

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/TalkTimeController.cs

@@ -349,7 +349,7 @@ namespace CallCenterApi.Interface.Controllers.report
349 349
                 sql += " and CallState=" + state.Trim();
350 350
             }
351 351
 
352
-            DataTable dt = DbHelperSQL.Query("SELECT UserId,UserCode,UserName,COUNT(*) AS calloutCount FROM T_Call_CallRecords where 1=1 " + sql + "  GROUP BY UserId,UserCode,UserName").Tables[0];
352
+            DataTable dt = DbHelperSQL.Query("SELECT UserId,UserCode,UserName,COUNT(*) AS calloutCount FROM T_Call_CallRecords where 1=1 " + sql + "  GROUP BY UserId,UserCode,UserName  having UserCode <> '0' ").Tables[0];
353 353
             Dictionary<string, int> myDictionary = new Dictionary<string, int>();
354 354
 
355 355
             foreach (Model.T_Sys_UserAccount item in userAccountList)

+ 2 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/TotalCallController.cs

@@ -59,7 +59,7 @@ namespace CallCenterApi.Interface.Controllers.report
59 59
                 {
60 60
                     if (roleId != 17)
61 61
                     {
62
-                        if (deptCode.IndexOf("|1|") > 0)
62
+                        if (deptCode.Replace("|0|1|", "").Length > 0)
63 63
                         {
64 64
                             if (roleId == 36 || roleId == 38 || roleId == 40)
65 65
                             {
@@ -252,7 +252,7 @@ namespace CallCenterApi.Interface.Controllers.report
252 252
                 {
253 253
                     if (roleId != 17)
254 254
                     {
255
-                        if (deptCode.IndexOf("|1|") > 0)
255
+                        if (deptCode.Replace("|0|1|", "").Length > 0)
256 256
                         {
257 257
                             if (roleId == 36 || roleId == 38 || roleId == 40)
258 258
                             {

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/YearContrastController.cs

@@ -174,7 +174,7 @@ namespace CallCenterApi.Interface.Controllers.report
174 174
                 {
175 175
                     if (roleId != 17)
176 176
                     {
177
-                        if (deptCode.IndexOf("|1|") > 0)
177
+                        if (deptCode.Replace("|0|1|", "").Length > 0)
178 178
                         {
179 179
                             if (roleId == 36 || roleId == 38 || roleId == 40)
180 180
                             {

+ 14 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiWorkTotalController.cs

@@ -18,7 +18,7 @@ namespace CallCenterApi.Interface.Controllers.report
18 18
         {
19 19
             ActionResult res = NoToken("未知错误,请重新登录");
20 20
 
21
-            String[] str = { "部门", "坐席", "坐席工号", "呼入电话数", "坐席接通量", "呼损量"
21
+            String[] str = { "部门", "坐席", "坐席工号","角色" ,"呼入电话数", "坐席接通量", "呼损量"
22 22
                         ,"接通率","呼损率","平均排队时间","接听通话次数","通话分钟数","通话秒数"
23 23
                         ,"平均接听通话秒数","平均振铃秒数","呼入占有率","用户评价","坐席登录次数"
24 24
                         ,"登录时长分钟数","工作时长分钟数","平均每天工作时长(小时)","平均操作分钟数"
@@ -414,6 +414,7 @@ namespace CallCenterApi.Interface.Controllers.report
414 414
             DataColumn dc1 = new DataColumn("部门");
415 415
             DataColumn dc2 = new DataColumn("坐席");
416 416
             DataColumn dc3 = new DataColumn("坐席工号");
417
+            DataColumn dc3_ = new DataColumn("角色");
417 418
             DataColumn dc4 = new DataColumn("呼入电话数");
418 419
             DataColumn dc5 = new DataColumn("坐席接通量");
419 420
             DataColumn dc6 = new DataColumn("呼损量");
@@ -441,6 +442,7 @@ namespace CallCenterApi.Interface.Controllers.report
441 442
             dtNew.Columns.Add(dc1);
442 443
             dtNew.Columns.Add(dc2);
443 444
             dtNew.Columns.Add(dc3);
445
+            dtNew.Columns.Add(dc3_);
444 446
             dtNew.Columns.Add(dc4);
445 447
             dtNew.Columns.Add(dc5);
446 448
             dtNew.Columns.Add(dc6);
@@ -525,10 +527,18 @@ namespace CallCenterApi.Interface.Controllers.report
525 527
                     {
526 528
                         usercodeSQL += $" and F_UserCode='{usercode}'";
527 529
                     }
528
-                    else
530
+                    else if (deptId != 1)
529 531
                     {
530 532
                         deptSQL += $" and F_DeptId={deptId} ";
531 533
                     }
534
+                    else
535
+                    {
536
+                        if (roleId != 53 && roleId != 54)
537
+                        {
538
+                            deptSQL += $" and F_DeptId={deptId} ";
539
+                        }
540
+
541
+                    }
532 542
 
533 543
                 }
534 544
             }
@@ -547,7 +557,7 @@ namespace CallCenterApi.Interface.Controllers.report
547 557
             foreach (DataRow dr in dtdpt.Rows)
548 558
             {
549 559
                 DataTable dt = new DataTable();
550
-                string sql = $"SELECT F_UserCode,F_UserName,F_WorkNumber,F_UserId FROM T_Sys_UserAccount where f_seatFlag=1 and F_DeptId={dr["F_DeptId"]} and F_WorkNumber!='' {usercodeSQL} order by  F_WorkNumber asc";
560
+                string sql = $"SELECT F_UserCode,F_UserName,F_WorkNumber,F_UserId,T_Sys_RoleInfo.F_RoleName FROM T_Sys_UserAccount left join T_Sys_RoleInfo on T_Sys_RoleInfo.F_RoleId=T_Sys_UserAccount.F_RoleId where f_seatFlag=1 and F_DeptId={dr["F_DeptId"]} and F_WorkNumber!='' {usercodeSQL} order by  F_WorkNumber asc";
551 561
                 dt = DbHelperSQL.Query(sql).Tables[0];
552 562
                 for (int i = 0; i < dt.Rows.Count; i++)
553 563
                 {
@@ -557,6 +567,7 @@ namespace CallCenterApi.Interface.Controllers.report
557 567
                         drNew["部门"] = dr["F_DeptName"].ToString();
558 568
                         drNew["坐席"] = dt.Rows[i]["F_UserName"].ToString();
559 569
                         drNew["坐席工号"] = dt.Rows[i]["F_WorkNumber"].ToString();
570
+                        drNew["角色"] = dt.Rows[i]["F_RoleName"].ToString();
560 571
                         //if (i == 0)
561 572
                         //{//呼入电话
562 573
 

+ 79 - 74
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -21,63 +21,63 @@ namespace CallCenterApi.Interface.Controllers.tel
21 21
             ActionResult res = NoToken("未知错误,请重新登录");
22 22
             if (Request.IsAuthenticated)
23 23
             {
24
-                
25
-                    int userId = CurrentUser.UserData.F_UserId;
26
-                    if (userId != 0)
24
+
25
+                int userId = CurrentUser.UserData.F_UserId;
26
+                if (userId != 0)
27
+                {
28
+                    Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
29
+                    if (ua != null)
27 30
                     {
28
-                        Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
29
-                        if (ua != null)
31
+                        string tel = HttpUtility.UrlDecode(RequestString.GetFormString("tel"));
32
+                        string callid = HttpUtility.UrlDecode(RequestString.GetFormString("callid"));
33
+                        int n = RequestString.GetInt("num", 0);
34
+                        int type = RequestString.GetInt("type", 0);
35
+                        Model.T_Call_Blacklist dModel = new BLL.T_Call_Blacklist().GetModelList(" F_TelPhone='" + tel + "' ").FirstOrDefault();
36
+
37
+                        var date = DateTime.Now;
38
+                        var enddate = date;
39
+                        switch (type)
40
+                        {
41
+                            case 1: enddate = enddate.AddDays(n); break;
42
+                            case 2: enddate = enddate.AddHours(n); break;
43
+                            case 3: enddate = enddate.AddMinutes(n); break;
44
+                            case 4: enddate = DateTime.MaxValue; break;
45
+                        }
46
+                        if (dModel == null)
30 47
                         {
31
-                            string tel = HttpUtility.UrlDecode(RequestString.GetFormString("tel"));
32
-                            string callid = HttpUtility.UrlDecode(RequestString.GetFormString("callid"));
33
-                            int n = RequestString.GetInt("num", 0);
34
-                            int type = RequestString.GetInt("type", 0);
35
-                            Model.T_Call_Blacklist dModel = new BLL.T_Call_Blacklist().GetModelList(" F_TelPhone='" + tel + "' ").FirstOrDefault();
36
-
37
-                            var date = DateTime.Now;
38
-                            var enddate = date;
39
-                            switch (type)
48
+                            dModel = new Model.T_Call_Blacklist();
49
+                            dModel.F_CallId = callid;
50
+                            dModel.F_TelPhone = tel.Trim();
51
+                            dModel.F_SetTime = date;
52
+                            dModel.F_RemoveTime = enddate;
53
+                            dModel.F_InterceptNum = 1;
54
+                            dModel.F_UserId = ua.F_UserId;
55
+                            int b = new BLL.T_Call_Blacklist().Add(dModel);
56
+                            if (b > 0)
40 57
                             {
41
-                                case 1: enddate = enddate.AddDays(n); break;
42
-                                case 2: enddate = enddate.AddHours(n); break;
43
-                                case 3: enddate = enddate.AddMinutes(n); break;
44
-                                case 4: enddate = DateTime.MaxValue; break;
58
+                                res = Success("添加成功", enddate.ToString("yyyy-MM-dd HH:mm:ss"));
45 59
                             }
46
-                            if (dModel == null)
60
+                            else
47 61
                             {
48
-                                dModel = new Model.T_Call_Blacklist();
49
-                                dModel.F_CallId = callid;
50
-                                dModel.F_TelPhone = tel.Trim();
51
-                                dModel.F_SetTime = date;
52
-                                dModel.F_RemoveTime = enddate;
53
-                                dModel.F_InterceptNum = 1;
54
-                                dModel.F_UserId = ua.F_UserId;
55
-                                int b = new BLL.T_Call_Blacklist().Add(dModel);
56
-                                if (b > 0)
57
-                                {
58
-                                    res = Success("添加成功", enddate.ToString("yyyy-MM-dd HH:mm:ss"));
59
-                                }
60
-                                else
61
-                                {
62
-                                    res = Error("添加失败");
63
-                                }
62
+                                res = Error("添加失败");
63
+                            }
64
+                        }
65
+                        else
66
+                        {
67
+
68
+                            dModel.F_RemoveTime = enddate;
69
+                            if (new BLL.T_Call_Blacklist().Update(dModel))
70
+                            {
71
+                                res = Success("修改成功", enddate.ToString("yyyy-MM-dd HH:mm:ss"));
64 72
                             }
65 73
                             else
66 74
                             {
67
-
68
-                                dModel.F_RemoveTime = enddate;
69
-                                if (new BLL.T_Call_Blacklist().Update(dModel))
70
-                                {
71
-                                    res = Success("修改成功", enddate.ToString("yyyy-MM-dd HH:mm:ss"));
72
-                                }
73
-                                else
74
-                                {
75
-                                    res = Error("修改失败");
76
-                                }
75
+                                res = Error("修改失败");
77 76
                             }
78 77
                         }
79 78
                     }
80
-              
79
+                }
80
+
81 81
             }
82 82
             return res;
83 83
         }
@@ -293,17 +293,17 @@ namespace CallCenterApi.Interface.Controllers.tel
293 293
                     }
294 294
                 }
295 295
 
296
-                int hrcount = new BLL.T_Call_CallRecords().GetRecordCount(" calltype=0 "+ sqlcount);
297
-                int hccount = new BLL.T_Call_CallRecords().GetRecordCount(" calltype=1 "+ sqlcount);
298
-                
296
+                int hrcount = new BLL.T_Call_CallRecords().GetRecordCount(" calltype=0 " + sqlcount);
297
+                int hccount = new BLL.T_Call_CallRecords().GetRecordCount(" calltype=1 " + sqlcount);
298
+
299 299
                 var obj = new
300 300
                 {
301 301
                     state = "success",
302 302
                     message = "成功",
303 303
                     rows = dt,
304 304
                     total = recordCount,
305
-                    hrcount=hrcount,
306
-                    hccount=hccount,
305
+                    hrcount = hrcount,
306
+                    hccount = hccount,
307 307
                 };
308 308
 
309 309
                 res = Content(obj.ToJson());
@@ -354,34 +354,34 @@ namespace CallCenterApi.Interface.Controllers.tel
354 354
             ActionResult res = NoToken("未知错误,请重新登录");
355 355
             if (Request.IsAuthenticated)
356 356
             {
357
-               
358
-                    int userId = CurrentUser.UserData.F_UserId;
359
-                    if (userId != 0)
357
+
358
+                int userId = CurrentUser.UserData.F_UserId;
359
+                if (userId != 0)
360
+                {
361
+                    Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
362
+                    if (ua != null)
360 363
                     {
361
-                        Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
362
-                        if (ua != null)
363
-                        {
364
-                            Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
365
-                            model.CallId = RequestString.GetFormString("callid");
366
-                            model.UserId = ua.F_UserId;
367
-                            model.UserCode = ua.F_UserCode;
368
-                            model.UserName = ua.F_UserName;
364
+                        Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
365
+                        model.CallId = RequestString.GetFormString("callid");
366
+                        model.UserId = ua.F_UserId;
367
+                        model.UserCode = ua.F_UserCode;
368
+                        model.UserName = ua.F_UserName;
369 369
                         //model.ExtNumber = ua.F_WorkNumber;
370 370
                         model.ExtNumber = CurrentUser.UserData.F_ExtensionNumber;
371 371
 
372
-                            model.DealType = 5;
373
-                            bool bl = new BLL.T_Call_CallRecords().UpdateCallInRingTelRecord(model);
374
-                            if (bl)
375
-                            {
376
-                                res = Success("更新振铃状态成功");
377
-                            }
378
-                            else
379
-                            {
380
-                                res = Error("更新振铃状态失败");
381
-                            }
372
+                        model.DealType = 5;
373
+                        bool bl = new BLL.T_Call_CallRecords().UpdateCallInRingTelRecord(model);
374
+                        if (bl)
375
+                        {
376
+                            res = Success("更新振铃状态成功");
377
+                        }
378
+                        else
379
+                        {
380
+                            res = Error("更新振铃状态失败");
382 381
                         }
383 382
                     }
384
-            
383
+                }
384
+
385 385
             }
386 386
             return res;
387 387
         }
@@ -405,11 +405,16 @@ namespace CallCenterApi.Interface.Controllers.tel
405 405
                 {
406 406
                     Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(model.CallId);
407 407
                     string type = vmodel.OperateType.ToString();
408
+                    //这里不知道  vmodel.OperateType=7 是什么时候. 
408 409
                     if (type == "7")
409 410
                     {
410 411
                         new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.OperateObject.ToString()), 1);
411 412
                     }
412
-
413
+                    //所以暂时先用  vmodel.TaskPhoneID 来判断是否是点击外呼的通话记录
414
+                    if (!string.IsNullOrWhiteSpace(vmodel.TaskPhoneID))
415
+                    {
416
+                        new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.TaskPhoneID.ToString()), 1);
417
+                    }
413 418
                     res = Success("更新摘机状态成功");
414 419
                 }
415 420
                 else

+ 3 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -22,7 +22,7 @@ namespace CallCenterApi.Interface.Controllers.tel
22 22
                 DataTable dt = new DataTable();
23 23
                 int roleid = CurrentUser.UserData.F_RoleId;
24 24
                 int deptid = CurrentUser.UserData.F_DeptId;
25
-                string deptcode = CurrentUser.UserData.F_DeptCode;
25
+                string deptCode = CurrentUser.UserData.F_DeptCode;
26 26
                 string callstate = HttpUtility.UrlDecode(RequestString.GetQueryString("callstate"));
27 27
                 string calltype = HttpUtility.UrlDecode(RequestString.GetQueryString("calltype"));
28 28
                 string starttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
@@ -43,7 +43,7 @@ namespace CallCenterApi.Interface.Controllers.tel
43 43
                     if (roleid != 17)
44 44
                     {
45 45
                         //各分公司
46
-                        if (deptcode.IndexOf("|1|") > 0)
46
+                        if (deptCode.Replace("|0|1|", "").Length > 0)
47 47
                         {
48 48
                             if (roleid == 36 || roleid == 38 || roleid == 40)
49 49
                             {
@@ -52,7 +52,7 @@ namespace CallCenterApi.Interface.Controllers.tel
52 52
                             }
53 53
                             else
54 54
                             {
55
-                                sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptID in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptcode + "%')) ";
55
+                                sql += " and UserCode in (select F_UserCode from T_Sys_UserAccount where F_DeptID in (select F_DeptId from T_Sys_Department where F_DeptCode like '" + deptCode + "%')) ";
56 56
                             }
57 57
                         }
58 58
                         //总公司

+ 0 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Filter/FilterBanCallOut.cs

@@ -10,7 +10,6 @@ namespace CallCenterApi.Interface.Models.Filter
10 10
     {
11 11
         public string Phone { get; set; }
12 12
         public DateTime? Start { get; set; }
13
-        public DateTime? End { get; set; }
14 13
 
15 14
     }
16 15
 }

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/BanCallOutInput.cs

@@ -8,6 +8,6 @@ namespace CallCenterApi.Interface.Models.Input
8 8
     public class BanCallOutInput
9 9
     {
10 10
         public string Phone { get; set; }
11
-
11
+        public string Remark { get; set; }
12 12
     }
13 13
 }

+ 2 - 2
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/DictionaryInput.cs

@@ -8,9 +8,9 @@ namespace CallCenterApi.Interface.Models.Input
8 8
     public class DictionaryBaseInput
9 9
     {
10 10
         public string DicFlag { get; set; }
11
-        public string Name { get; set; }
11
+        public string DicName { get; set; }
12 12
         public int Sort { get; set; } = 0;
13
-        public string Remark { get; set; }
13
+        public string DicRemark { get; set; }
14 14
 
15 15
     }
16 16
 

+ 1 - 0
CallCenterApi/CallCenterApi.Model/T_Call_BanCallOut.cs

@@ -11,5 +11,6 @@ namespace CallCenterApi.Model
11 11
         public int Id { get; set; }
12 12
         public string F_Phone { get; set; }
13 13
         public DateTime? F_SetTime { get; set; }
14
+        public string F_Remark { get; set; }
14 15
     }
15 16
 }