Browse Source

自定义字段接口调整
自动外呼质检接口

yuqian 8 years ago
parent
commit
76ae5a1a86

+ 1 - 0
CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj

@@ -80,6 +80,7 @@
80 80
     <Compile Include="T_QC_IndexBase.cs" />
81 81
     <Compile Include="T_QC_IndexCategory.cs" />
82 82
     <Compile Include="T_QC_IndexRes.cs" />
83
+    <Compile Include="T_QC_IndexResAutoCall.cs" />
83 84
     <Compile Include="T_RegionCategory.cs" />
84 85
     <Compile Include="T_RepositoryCategory.cs" />
85 86
     <Compile Include="T_RepositoryInformation.cs" />

+ 25 - 1
CallCenterApi/CallCenterApi.BLL/CallResult.cs

@@ -31,11 +31,35 @@ namespace CallCenterApi.BLL
31 31
             }
32 32
             return modelList;
33 33
         }
34
+        /// <summary>
35
+        /// 获得数据列表
36
+        /// </summary>
37
+        public List<Model.CallResult> DataTableToListQC(DataTable dt)
38
+        {
39
+            List<Model.CallResult> modelList = new List<Model.CallResult>();
40
+            int rowsCount = dt.Rows.Count;
41
+            if (rowsCount > 0)
42
+            {
43
+                Model.CallResult model;
44
+                for (int n = 0; n < rowsCount; n++)
45
+                {
46
+                    model = dal.DataRowToModelQC(dt.Rows[n]);
47
+                    if (model != null)
48
+                    {
49
+                        modelList.Add(model);
50
+                    }
51
+                }
52
+            }
53
+            return modelList;
54
+        }
34 55
         public Model.CallResult GetModel(string callId)
35 56
         {
36 57
             return dal.GetModel(callId);
37 58
         }
38
-
59
+        public bool UpdateQC(Model.CallResult model)
60
+        {
61
+            return dal.UpdateQC(model);
62
+        }
39 63
         #endregion  BasicMethod
40 64
         #region  ExtensionMethod
41 65
 

+ 4 - 0
CallCenterApi/CallCenterApi.BLL/T_Cus_CustomerField.cs

@@ -62,6 +62,10 @@ namespace CallCenterApi.BLL
62 62
             return dal.Delete(id);
63 63
         }
64 64
 
65
+        public bool DeleteBatch(string where)
66
+        {
67
+            return dal.DeleteBatch(where);
68
+        }
65 69
         public List<Model.T_Cus_CustomerField> GetList()
66 70
         {
67 71
             var dt = dal.GetList();

+ 158 - 0
CallCenterApi/CallCenterApi.BLL/T_QC_IndexResAutoCall.cs

@@ -0,0 +1,158 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace CallCenterApi.BLL
9
+{
10
+    /// <summary>
11
+    /// T_QC_IndexResAutoCall
12
+    /// </summary>
13
+    public partial class T_QC_IndexResAutoCall
14
+    {
15
+        private readonly DAL.T_QC_IndexResAutoCall dal = new DAL.T_QC_IndexResAutoCall();
16
+        public T_QC_IndexResAutoCall()
17
+        { }
18
+        #region  Method
19
+        /// <summary>
20
+        /// 是否存在该记录
21
+        /// </summary>
22
+        public bool Exists(int F_Id)
23
+        {
24
+            return dal.Exists(F_Id);
25
+        }
26
+
27
+        /// <summary>
28
+        /// 增加一条数据
29
+        /// </summary>
30
+        public int Add(Model.T_QC_IndexResAutoCall model)
31
+        {
32
+            return dal.Add(model);
33
+        }
34
+
35
+        /// <summary>
36
+        /// 更新一条数据
37
+        /// </summary>
38
+        public bool Update(Model.T_QC_IndexResAutoCall model)
39
+        {
40
+            return dal.Update(model);
41
+        }
42
+
43
+        /// <summary>
44
+        /// 删除一条数据
45
+        /// </summary>
46
+        public bool Delete(int F_Id)
47
+        {
48
+
49
+            return dal.Delete(F_Id);
50
+        }
51
+        /// <summary>
52
+        /// 删除一条数据
53
+        /// </summary>
54
+        public bool DeleteList(string F_Idlist)
55
+        {
56
+            return dal.DeleteList(F_Idlist);
57
+        }
58
+
59
+        /// <summary>
60
+        /// 得到一个对象实体
61
+        /// </summary>
62
+        public Model.T_QC_IndexResAutoCall GetModel(int F_Id)
63
+        {
64
+
65
+            return dal.GetModel(F_Id);
66
+        }
67
+
68
+        /// <summary>
69
+        /// 获得数据列表
70
+        /// </summary>
71
+        public DataSet GetList(string strWhere)
72
+        {
73
+            return dal.GetList(strWhere);
74
+        }
75
+        /// <summary>
76
+        /// 获得前几行数据
77
+        /// </summary>
78
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
79
+        {
80
+            return dal.GetList(Top, strWhere, filedOrder);
81
+        }
82
+        /// <summary>
83
+        /// 获得数据列表
84
+        /// </summary>
85
+        public List<Model.T_QC_IndexResAutoCall> GetModelList(string strWhere)
86
+        {
87
+            DataSet ds = dal.GetList(strWhere);
88
+            return DataTableToList(ds.Tables[0]);
89
+        }
90
+        /// <summary>
91
+        /// 获得数据列表
92
+        /// </summary>
93
+        public List<Model.T_QC_IndexResAutoCall> DataTableToList(DataTable dt)
94
+        {
95
+            List<Model.T_QC_IndexResAutoCall> modelList = new List<Model.T_QC_IndexResAutoCall>();
96
+            int rowsCount = dt.Rows.Count;
97
+            if (rowsCount > 0)
98
+            {
99
+                Model.T_QC_IndexResAutoCall model;
100
+                for (int n = 0; n < rowsCount; n++)
101
+                {
102
+                    model = new Model.T_QC_IndexResAutoCall();
103
+                    if (dt.Rows[n]["F_Id"] != null && dt.Rows[n]["F_Id"].ToString() != "")
104
+                    {
105
+                        model.F_Id = int.Parse(dt.Rows[n]["F_Id"].ToString());
106
+                    }
107
+                    if (dt.Rows[n]["CallRecordsId"] != null && dt.Rows[n]["CallRecordsId"].ToString() != "")
108
+                    {
109
+                        model.CallRecordsId = int.Parse(dt.Rows[n]["CallRecordsId"].ToString());
110
+                    }
111
+                    if (dt.Rows[n]["F_IndexId"] != null && dt.Rows[n]["F_IndexId"].ToString() != "")
112
+                    {
113
+                        model.F_IndexId = int.Parse(dt.Rows[n]["F_IndexId"].ToString());
114
+                    }
115
+                    if (dt.Rows[n]["F_Score"] != null && dt.Rows[n]["F_Score"].ToString() != "")
116
+                    {
117
+                        model.F_Score = int.Parse(dt.Rows[n]["F_Score"].ToString());
118
+                    }
119
+                    if (dt.Rows[n]["F_QCScore"] != null && dt.Rows[n]["F_QCScore"].ToString() != "")
120
+                    {
121
+                        model.F_QCScore = int.Parse(dt.Rows[n]["F_QCScore"].ToString());
122
+                    }
123
+                    if (dt.Rows[n]["F_Remark"] != null && dt.Rows[n]["F_Remark"].ToString() != "")
124
+                    {
125
+                        model.F_Remark = dt.Rows[n]["F_Remark"].ToString();
126
+                    }
127
+                    modelList.Add(model);
128
+                }
129
+            }
130
+            return modelList;
131
+        }
132
+
133
+        /// <summary>
134
+        /// 获得数据列表
135
+        /// </summary>
136
+        public DataSet GetAllList()
137
+        {
138
+            return GetList("");
139
+        }
140
+
141
+        /// <summary>
142
+        /// 分页获取数据列表
143
+        /// </summary>
144
+        public int GetRecordCount(string strWhere)
145
+        {
146
+            return dal.GetRecordCount(strWhere);
147
+        }
148
+        /// <summary>
149
+        /// 分页获取数据列表
150
+        /// </summary>
151
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
152
+        {
153
+            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
154
+        }
155
+
156
+        #endregion  Method
157
+    }
158
+}

+ 1 - 0
CallCenterApi/CallCenterApi.DAL/CallCenterApi.DAL.csproj

@@ -80,6 +80,7 @@
80 80
     <Compile Include="T_QC_IndexBase.cs" />
81 81
     <Compile Include="T_QC_IndexCategory.cs" />
82 82
     <Compile Include="T_QC_IndexRes.cs" />
83
+    <Compile Include="T_QC_IndexResAutoCall.cs" />
83 84
     <Compile Include="T_RegionCategory.cs" />
84 85
     <Compile Include="T_RepositoryCategory.cs" />
85 86
     <Compile Include="T_RepositoryInformation.cs" />

+ 67 - 0
CallCenterApi/CallCenterApi.DAL/CallRecords.cs

@@ -36,6 +36,35 @@ namespace CallCenterApi.DAL
36 36
             }
37 37
             return model;
38 38
         }
39
+        public Model.CallResult DataRowToModelQC(DataRow row)
40
+        {
41
+            Model.CallResult model = new Model.CallResult();
42
+            if (row != null)
43
+            {
44
+                model.Id = row["Id"] == DBNull.Value ? 0 : Convert.ToInt32(row["Id"]);
45
+                model.TaskName = row["TaskName"] == DBNull.Value ? "" : row["TaskName"].ToString();
46
+                model.TaskId = row["itemid"] == DBNull.Value ? 0 : Convert.ToInt32(row["itemid"]);
47
+                model.CallNumber = row["Callee"] == DBNull.Value ? "" : row["Callee"].ToString();
48
+                model.Usercode = row["AgentId"] == DBNull.Value ? "" : row["AgentId"].ToString();
49
+                model.StartDate = row["StartDate"] == DBNull.Value ? (DateTime?)null : Convert.ToDateTime(row["StartDate"].ToString());
50
+                model.GetInAgentDate = row["GetInAgentDate"] == DBNull.Value ? (DateTime?)null : Convert.ToDateTime(row["GetInAgentDate"].ToString());
51
+                model.EndDate = row["EndDate"] == DBNull.Value ? (DateTime?)null : Convert.ToDateTime(row["EndDate"].ToString());
52
+                model.RecordPath = row["RecordPath"] == DBNull.Value ? "" : row["RecordPath"].ToString();
53
+                model.Username = row["Username"] == DBNull.Value ? "" : row["Username"].ToString();
54
+                model.CallType = row["CallType"] == DBNull.Value ? 1 : Convert.ToInt32(row["CallType"].ToString());
55
+                model.TalkTime = row["TalkTime"] == DBNull.Value ? 0 : Convert.ToInt32(row["TalkTime"]);
56
+                model.QCState = row["QCState"] == DBNull.Value ? 0 : Convert.ToInt32(row["QCState"].ToString());
57
+                model.QCScore = row["QCScore"] == DBNull.Value ? 0 : Convert.ToInt32(row["QCScore"].ToString());
58
+                model.QCRemark = row["QCRemark"] == DBNull.Value ? "" : row["QCRemark"].ToString();
59
+                model.QCUserId = row["QCUserId"] == DBNull.Value ? 0 : Convert.ToInt32(row["QCUserId"].ToString());
60
+                model.QCUserCode = row["QCUserCode"] == DBNull.Value ? "" : row["QCUserCode"].ToString();
61
+                model.QCUserName = row["QCUserName"] == DBNull.Value ? "" : row["QCUserName"].ToString();
62
+                model.QCTime = row["QCTime"] == DBNull.Value ? (DateTime?)null : Convert.ToDateTime(row["QCTime"].ToString());
63
+
64
+
65
+            }
66
+            return model;
67
+        }
39 68
         public Model.CallResult GetModel(string callId)
40 69
         {
41 70
             string sql = "select itemid,RecordPath from CallResult where id=@callid";
@@ -53,6 +82,44 @@ namespace CallCenterApi.DAL
53 82
             }
54 83
             return model;
55 84
         }
85
+        public bool UpdateQC(Model.CallResult model)
86
+        {
87
+            StringBuilder strSql = new StringBuilder();
88
+            strSql.Append("update CallResult set ");
89
+            strSql.Append("QCState=@QCState,");
90
+            strSql.Append("QCScore=@QCScore,");
91
+            strSql.Append("QCRemark=@QCRemark,");
92
+            strSql.Append("QCUserId=@QCUserId,");
93
+            strSql.Append("QCUserCode=@QCUserCode,");
94
+            strSql.Append("QCUserName=@QCUserName,");
95
+            strSql.Append("QCTime=@QCTime ");
96
+            strSql.Append(" where Id=@Id");
97
+            SqlParameter[] parameters = {
98
+                    new SqlParameter("@QCState", SqlDbType.SmallInt,2),
99
+                    new SqlParameter("@QCScore", SqlDbType.Decimal,9),
100
+                    new SqlParameter("@QCRemark", SqlDbType.Text),
101
+                    new SqlParameter("@QCUserId", SqlDbType.Int),
102
+                    new SqlParameter("@QCUserName", SqlDbType.NVarChar,50),
103
+                    new SqlParameter("@QCTime", SqlDbType.DateTime),
104
+                    new SqlParameter("@Id", SqlDbType.Int)};
105
+            parameters[0].Value = model.QCState;
106
+            parameters[1].Value = model.QCScore;
107
+            parameters[2].Value = model.QCRemark;
108
+            parameters[3].Value = model.QCUserId;
109
+            parameters[4].Value = model.QCUserName;
110
+            parameters[5].Value = model.QCTime;
111
+            parameters[9].Value = model.Id;
112
+
113
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
114
+            if (rows > 0)
115
+            {
116
+                return true;
117
+            }
118
+            else
119
+            {
120
+                return false;
121
+            }
122
+        }
56 123
         #endregion  BasicMethod
57 124
         #region  ExtensionMethod
58 125
 

+ 6 - 1
CallCenterApi/CallCenterApi.DAL/T_Cus_CustomerField.cs

@@ -42,7 +42,7 @@ namespace CallCenterApi.DAL
42 42
 
43 43
         public bool Update(Model.T_Cus_CustomerField model)
44 44
         {
45
-            string sql = "update T_Cus_CustomerField set  F_Id=@F_Id,F_FieldType=@F_FieldType,F_FieldId=@F_FieldId,F_Name=@F_Name,F_DBTypeName=@F_DBTypeName,F_DBFieldName=@F_DBFieldName,F_Sort=@F_Sort,F_CharLength=@F_CharLength,F_IsNecessary=@F_IsNecessary,F_IsExportOrInput=@F_IsExportOrInput,F_IsShowOnList=@F_IsShowOnList,F_IsShowOnScrean=@F_IsShowOnScrean,F_Search=@F_Search where F_Id=@F_Id";
45
+            string sql = "update T_Cus_CustomerField set F_FieldType=@F_FieldType,F_FieldId=@F_FieldId,F_Name=@F_Name,F_DBTypeName=@F_DBTypeName,F_DBFieldName=@F_DBFieldName,F_Sort=@F_Sort,F_CharLength=@F_CharLength,F_IsNecessary=@F_IsNecessary,F_IsExportOrInput=@F_IsExportOrInput,F_IsShowOnList=@F_IsShowOnList,F_IsShowOnScrean=@F_IsShowOnScrean,F_Search=@F_Search where F_Id=@F_Id";
46 46
             return DbHelperSQL.ExecuteSql(sql, new SqlParameter[] {
47 47
                 new SqlParameter("@F_Id",model.F_Id),
48 48
                 new SqlParameter("@F_FieldType",model.F_FieldType),
@@ -72,6 +72,11 @@ namespace CallCenterApi.DAL
72 72
             return DbHelperSQL.ExecuteSql(sql, new SqlParameter("@F_Id", id)) > 0;
73 73
         }
74 74
 
75
+        public bool DeleteBatch(string where)
76
+        {
77
+            string sql = $"delete T_Cus_CustomerField where {where}";
78
+            return DbHelperSQL.ExecuteSql(sql) > 0;
79
+        }
75 80
         public int Add(Model.T_Cus_CustomerField model)
76 81
         {
77 82
             string sql = "insert into T_Cus_CustomerField (F_FieldType,F_FieldId,F_Name,F_DBTypeName,F_DBFieldName) value (@F_FieldType,@F_FieldId,@F_Name,@F_DBTypeName,@F_DBFieldName)";

+ 287 - 0
CallCenterApi/CallCenterApi.DAL/T_QC_IndexResAutoCall.cs

@@ -0,0 +1,287 @@
1
+using CallCenterApi.DB;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Data.SqlClient;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+
10
+namespace CallCenterApi.DAL
11
+{
12
+    /// <summary>
13
+    /// 数据访问类:T_QC_IndexResAutoCall
14
+    /// </summary>
15
+    public partial class T_QC_IndexResAutoCall
16
+    {
17
+        public T_QC_IndexResAutoCall()
18
+        { }
19
+        #region  Method
20
+        /// <summary>
21
+        /// 是否存在该记录
22
+        /// </summary>
23
+        public bool Exists(int F_Id)
24
+        {
25
+            StringBuilder strSql = new StringBuilder();
26
+            strSql.Append("select count(1) from T_QC_IndexResAutoCall");
27
+            strSql.Append(" where F_Id=@F_Id");
28
+            SqlParameter[] parameters = {
29
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
30
+            };
31
+            parameters[0].Value = F_Id;
32
+
33
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
34
+        }
35
+
36
+
37
+        /// <summary>
38
+        /// 增加一条数据
39
+        /// </summary>
40
+        public int Add(Model.T_QC_IndexResAutoCall model)
41
+        {
42
+            StringBuilder strSql = new StringBuilder();
43
+            strSql.Append("insert into T_QC_IndexResAutoCall(");
44
+            strSql.Append("CallRecordsId,F_IndexId,F_Score,F_QCScore,F_Remark)");
45
+            strSql.Append(" values (");
46
+            strSql.Append("@CallRecordsId,@F_IndexId,@F_Score,@F_QCScore,@F_Remark)");
47
+            strSql.Append(";select @@IDENTITY");
48
+            SqlParameter[] parameters = {
49
+                    new SqlParameter("@CallRecordsId", SqlDbType.Int,4),
50
+                    new SqlParameter("@F_IndexId", SqlDbType.Int,4),
51
+                    new SqlParameter("@F_Score", SqlDbType.Int,4),
52
+                    new SqlParameter("@F_QCScore", SqlDbType.Int,4),
53
+                    new SqlParameter("@F_Remark", SqlDbType.NVarChar,2000)};
54
+            parameters[0].Value = model.CallRecordsId;
55
+            parameters[1].Value = model.F_IndexId;
56
+            parameters[2].Value = model.F_Score;
57
+            parameters[3].Value = model.F_QCScore;
58
+            parameters[4].Value = model.F_Remark;
59
+
60
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
61
+            if (obj == null)
62
+            {
63
+                return 0;
64
+            }
65
+            else
66
+            {
67
+                return Convert.ToInt32(obj);
68
+            }
69
+        }
70
+        /// <summary>
71
+        /// 更新一条数据
72
+        /// </summary>
73
+        public bool Update(Model.T_QC_IndexResAutoCall model)
74
+        {
75
+            StringBuilder strSql = new StringBuilder();
76
+            strSql.Append("update T_QC_IndexResAutoCall set ");
77
+            strSql.Append("CallRecordsId=@CallRecordsId,");
78
+            strSql.Append("F_IndexId=@F_IndexId,");
79
+            strSql.Append("F_Score=@F_Score,");
80
+            strSql.Append("F_QCScore=@F_QCScore,");
81
+            strSql.Append("F_Remark=@F_Remark");
82
+            strSql.Append(" where F_Id=@F_Id");
83
+            SqlParameter[] parameters = {
84
+                    new SqlParameter("@CallRecordsId", SqlDbType.Int,4),
85
+                    new SqlParameter("@F_IndexId", SqlDbType.Int,4),
86
+                    new SqlParameter("@F_Score", SqlDbType.Int,4),
87
+                    new SqlParameter("@F_QCScore", SqlDbType.Int,4),
88
+                    new SqlParameter("@F_Remark", SqlDbType.NVarChar,2000),
89
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)};
90
+            parameters[0].Value = model.CallRecordsId;
91
+            parameters[1].Value = model.F_IndexId;
92
+            parameters[2].Value = model.F_Score;
93
+            parameters[3].Value = model.F_QCScore;
94
+            parameters[4].Value = model.F_Remark;
95
+            parameters[5].Value = model.F_Id;
96
+
97
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
98
+            if (rows > 0)
99
+            {
100
+                return true;
101
+            }
102
+            else
103
+            {
104
+                return false;
105
+            }
106
+        }
107
+
108
+        /// <summary>
109
+        /// 删除一条数据
110
+        /// </summary>
111
+        public bool Delete(int F_Id)
112
+        {
113
+
114
+            StringBuilder strSql = new StringBuilder();
115
+            strSql.Append("delete from T_QC_IndexResAutoCall ");
116
+            strSql.Append(" where F_Id=@F_Id");
117
+            SqlParameter[] parameters = {
118
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
119
+            };
120
+            parameters[0].Value = F_Id;
121
+
122
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
123
+            if (rows > 0)
124
+            {
125
+                return true;
126
+            }
127
+            else
128
+            {
129
+                return false;
130
+            }
131
+        }
132
+        /// <summary>
133
+        /// 批量删除数据
134
+        /// </summary>
135
+        public bool DeleteList(string F_Idlist)
136
+        {
137
+            StringBuilder strSql = new StringBuilder();
138
+            strSql.Append("delete from T_QC_IndexResAutoCall ");
139
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
140
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
141
+            if (rows > 0)
142
+            {
143
+                return true;
144
+            }
145
+            else
146
+            {
147
+                return false;
148
+            }
149
+        }
150
+
151
+
152
+        /// <summary>
153
+        /// 得到一个对象实体
154
+        /// </summary>
155
+        public Model.T_QC_IndexResAutoCall GetModel(int F_Id)
156
+        {
157
+
158
+            StringBuilder strSql = new StringBuilder();
159
+            strSql.Append("select  top 1 F_Id,CallRecordsId,F_IndexId,F_Score,F_QCScore,F_Remark from T_QC_IndexResAutoCall ");
160
+            strSql.Append(" where F_Id=@F_Id");
161
+            SqlParameter[] parameters = {
162
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
163
+            };
164
+            parameters[0].Value = F_Id;
165
+
166
+            Model.T_QC_IndexResAutoCall model = new Model.T_QC_IndexResAutoCall();
167
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
168
+            if (ds.Tables[0].Rows.Count > 0)
169
+            {
170
+                if (ds.Tables[0].Rows[0]["F_Id"] != null && ds.Tables[0].Rows[0]["F_Id"].ToString() != "")
171
+                {
172
+                    model.F_Id = int.Parse(ds.Tables[0].Rows[0]["F_Id"].ToString());
173
+                }
174
+                if (ds.Tables[0].Rows[0]["CallRecordsId"] != null && ds.Tables[0].Rows[0]["CallRecordsId"].ToString() != "")
175
+                {
176
+                    model.CallRecordsId = int.Parse(ds.Tables[0].Rows[0]["CallRecordsId"].ToString());
177
+                }
178
+                if (ds.Tables[0].Rows[0]["F_IndexId"] != null && ds.Tables[0].Rows[0]["F_IndexId"].ToString() != "")
179
+                {
180
+                    model.F_IndexId = int.Parse(ds.Tables[0].Rows[0]["F_IndexId"].ToString());
181
+                }
182
+                if (ds.Tables[0].Rows[0]["F_Score"] != null && ds.Tables[0].Rows[0]["F_Score"].ToString() != "")
183
+                {
184
+                    model.F_Score = int.Parse(ds.Tables[0].Rows[0]["F_Score"].ToString());
185
+                }
186
+                if (ds.Tables[0].Rows[0]["F_QCScore"] != null && ds.Tables[0].Rows[0]["F_QCScore"].ToString() != "")
187
+                {
188
+                    model.F_QCScore = int.Parse(ds.Tables[0].Rows[0]["F_QCScore"].ToString());
189
+                }
190
+                if (ds.Tables[0].Rows[0]["F_Remark"] != null && ds.Tables[0].Rows[0]["F_Remark"].ToString() != "")
191
+                {
192
+                    model.F_Remark = ds.Tables[0].Rows[0]["F_Remark"].ToString();
193
+                }
194
+                return model;
195
+            }
196
+            else
197
+            {
198
+                return null;
199
+            }
200
+        }
201
+
202
+        /// <summary>
203
+        /// 获得数据列表
204
+        /// </summary>
205
+        public DataSet GetList(string strWhere)
206
+        {
207
+            StringBuilder strSql = new StringBuilder();
208
+            strSql.Append("select F_Id,CallRecordsId,F_IndexId,F_Score,F_QCScore,F_Remark ");
209
+            strSql.Append(" FROM T_QC_IndexResAutoCall ");
210
+            if (strWhere.Trim() != "")
211
+            {
212
+                strSql.Append(" where " + strWhere);
213
+            }
214
+            return DbHelperSQL.Query(strSql.ToString());
215
+        }
216
+
217
+        /// <summary>
218
+        /// 获得前几行数据
219
+        /// </summary>
220
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
221
+        {
222
+            StringBuilder strSql = new StringBuilder();
223
+            strSql.Append("select ");
224
+            if (Top > 0)
225
+            {
226
+                strSql.Append(" top " + Top.ToString());
227
+            }
228
+            strSql.Append(" F_Id,CallRecordsId,F_IndexId,F_Score,F_QCScore,F_Remark ");
229
+            strSql.Append(" FROM T_QC_IndexResAutoCall ");
230
+            if (strWhere.Trim() != "")
231
+            {
232
+                strSql.Append(" where " + strWhere);
233
+            }
234
+            strSql.Append(" order by " + filedOrder);
235
+            return DbHelperSQL.Query(strSql.ToString());
236
+        }
237
+
238
+        /// <summary>
239
+        /// 获取记录总数
240
+        /// </summary>
241
+        public int GetRecordCount(string strWhere)
242
+        {
243
+            StringBuilder strSql = new StringBuilder();
244
+            strSql.Append("select count(1) FROM T_QC_IndexResAutoCall ");
245
+            if (strWhere.Trim() != "")
246
+            {
247
+                strSql.Append(" where " + strWhere);
248
+            }
249
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
250
+            if (obj == null)
251
+            {
252
+                return 0;
253
+            }
254
+            else
255
+            {
256
+                return Convert.ToInt32(obj);
257
+            }
258
+        }
259
+        /// <summary>
260
+        /// 分页获取数据列表
261
+        /// </summary>
262
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
263
+        {
264
+            StringBuilder strSql = new StringBuilder();
265
+            strSql.Append("SELECT * FROM ( ");
266
+            strSql.Append(" SELECT ROW_NUMBER() OVER (");
267
+            if (!string.IsNullOrEmpty(orderby.Trim()))
268
+            {
269
+                strSql.Append("order by T." + orderby);
270
+            }
271
+            else
272
+            {
273
+                strSql.Append("order by T.F_Id desc");
274
+            }
275
+            strSql.Append(")AS Row, T.*  from T_QC_IndexResAutoCall T ");
276
+            if (!string.IsNullOrEmpty(strWhere.Trim()))
277
+            {
278
+                strSql.Append(" WHERE " + strWhere);
279
+            }
280
+            strSql.Append(" ) TT");
281
+            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
282
+            return DbHelperSQL.Query(strSql.ToString());
283
+        }
284
+
285
+        #endregion  Method
286
+    }
287
+}

+ 9 - 15
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerFieldController.cs

@@ -45,16 +45,6 @@ namespace CallCenterApi.Interface.Controllers.customer
45 45
             return Content(obj.ToJson());
46 46
         }
47 47
 
48
-        //public ActionResult GetModel(int id)
49
-        //{
50
-        //    if (id <= 0)
51
-        //        return Error("参数不正确");
52
-        //    var model = customerFieldBLL.GetModel(id);
53
-        //    if (model != null)
54
-        //        return Error("该条记录不存在");
55
-        //    return Success("", model);
56
-        //}
57
-
58 48
         /// <summary>
59 49
         /// 添加选中的自定义字段 / 修改已选中的自定义字段
60 50
         /// </summary>
@@ -80,7 +70,7 @@ namespace CallCenterApi.Interface.Controllers.customer
80 70
             if (input.Id > 0)
81 71
             {
82 72
                 model = customerFieldBLL.GetModel(input.Id);
83
-                if (model != null)
73
+                if (model == null)
84 74
                     return Error("该条记录不存在");
85 75
                 model.F_Name = string.IsNullOrWhiteSpace(input.Name) ? model.F_Name : input.Name;
86 76
                 model.F_Sort = input.Sort > 0 ? input.Sort : model.F_Sort;
@@ -104,11 +94,15 @@ namespace CallCenterApi.Interface.Controllers.customer
104 94
         /// </summary>
105 95
         /// <param name="id"></param>
106 96
         /// <returns></returns>
107
-        public ActionResult Delete(int id)
97
+        public ActionResult Delete(int[] ids)
108 98
         {
109
-            if (customerFieldBLL.Delete(id))
110
-                return Success("删除失败");
111
-            return Error("删除成功");
99
+            if (ids != null && ids.Length > 0)
100
+            {
101
+                if (customerFieldBLL.DeleteBatch($" F_Id in ({string.Join(",", ids)}) "))
102
+                    return Success("删除成功");
103
+                return Error("删除失败");
104
+            }
105
+            return Error("参数错误");
112 106
         }
113 107
 
114 108
         /// <summary>

+ 419 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/quality/QCManageController.cs

@@ -1,10 +1,13 @@
1 1
 using CallCenter.Utility;
2
+using CallCenter.Utility.Time;
2 3
 using CallCenterApi.DB;
3 4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Interface.Models.Filter;
4 6
 using System;
5 7
 using System.Collections.Generic;
6 8
 using System.Data;
7 9
 using System.Linq;
10
+using System.Text;
8 11
 using System.Web;
9 12
 using System.Web.Mvc;
10 13
 
@@ -13,6 +16,9 @@ namespace CallCenterApi.Interface.Controllers.quality
13 16
     public class QCManageController : BaseController
14 17
     {
15 18
         private readonly BLL.T_Sys_UserAccount userBLL = new BLL.T_Sys_UserAccount();
19
+        private readonly BLL.CallResult callResultBLL = new BLL.CallResult();
20
+
21
+        #region 非自动外呼质检
16 22
         //获取未质检列表
17 23
         public ActionResult GetList()
18 24
         {
@@ -593,5 +599,418 @@ namespace CallCenterApi.Interface.Controllers.quality
593 599
             return res;
594 600
         }
595 601
 
602
+        #endregion
603
+
604
+        #region 自动外呼质检—号码质检
605
+        /// <summary>
606
+        /// 未质检列表
607
+        /// </summary>
608
+        /// <returns></returns>
609
+        public ActionResult GetAutoCallList(FilterTalkRecord filter)
610
+        {
611
+            var sort = "ORDER BY startdate desc";
612
+            if (!string.IsNullOrWhiteSpace(filter.SortField))
613
+            {
614
+                var arr = filter.SortField.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
615
+                EnumTalkRecordsSortField e;
616
+                if (!Enum.TryParse(arr[0], out e))
617
+                    return Error("排序字段参数错误");
618
+                sort = "ORDER BY " + e.ToString() + " " + arr[1];
619
+            }
620
+
621
+            StringBuilder where = new StringBuilder();
622
+
623
+
624
+            if (!string.IsNullOrWhiteSpace(filter.UserCode))
625
+            {
626
+                where.Append(" and agentid=" + filter.UserCode);
627
+            }
628
+            if (!string.IsNullOrWhiteSpace(filter.Phone))
629
+            {
630
+                where.Append(" and callee like '%" + filter.Phone + "%'");
631
+            }
632
+
633
+            if (!string.IsNullOrWhiteSpace(filter.TalkTime))
634
+            {
635
+                var arr = filter.TalkTime.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
636
+                if (arr.Length == 2)
637
+                {
638
+                    if (arr[0] == "1")
639
+                    {
640
+                        where.Append(" and talktime>" + arr[1]);
641
+                    }
642
+                    else if (arr[0] == "2")
643
+                    {
644
+                        where.Append(" and talktime=" + arr[1]);
645
+                    }
646
+                    else if (arr[0] == "3")
647
+                    {
648
+                        where.Append(" and talktime<" + arr[1]);
649
+                    }
650
+                    else { }
651
+                }
652
+            }
653
+
654
+            if (filter.StartTime == null || filter.EndTime == null)
655
+            {
656
+                filter.StartTime = DateTools.FirstSecondOfOneDay(DateTime.Now);
657
+                filter.EndTime = DateTools.LastSecondOfOneDay(DateTime.Now);
658
+            }
659
+            //qcstate=1 = 已质检;  qcstate=0 =未质检
660
+            //qcstate  全部=0;未转坐席 = 1; 被叫接通转坐席未接 = 2; 转坐席且接通 = 3,
661
+            where.Append(" and qcstate=0   and calltype in (2,3)   and datediff(s,'" + filter.StartTime + "',StartDate)>=0 and datediff(s,EndDate,'" + filter.EndTime + "')>=0 ");
662
+
663
+            int recordCount = 0;
664
+            Model.PageData<Model.CallResult> pageModel = new Model.PageData<Model.CallResult>();
665
+            StringBuilder fields = new StringBuilder();
666
+            var dt = BLL.PagerBLL.GetListPager(
667
+                       "V_AutoCallResult",
668
+                       "Id",
669
+                       "id,itemid,taskname, callee, agentid, username,startdate,enddate,getinagentdate,calltype,talktime,RecordPath, QCState, QCScore, QCRemark, QCUserId, QCUserName,QCTime",
670
+                       where.ToString(),
671
+                       sort,
672
+                       filter.PageSize,
673
+                       filter.PageIndex,
674
+                       true,
675
+                       out recordCount);
676
+            var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
677
+            var callResultList = callResultBLL.DataTableToListQC(dt);
678
+
679
+            var obj = new
680
+            {
681
+                rows = callResultList.Select(x => new
682
+                {
683
+                    id = x.Id,
684
+                    taskid = x.TaskId,
685
+                    callnumber = x.CallNumber,
686
+                    usercode = x.Usercode == "0" ? "" : x.Usercode,
687
+                    startdate = x.StartDate?.ToString("yyyy-MM-dd HH:mm:ss") ?? "",
688
+                    getinagentdate = x.GetInAgentDate?.ToString("yyyy-MM-dd HH:mm:ss") ?? "",
689
+                    enddate = x.EndDate?.ToString("yyyy-MM-dd HH:mm:ss") ?? "",
690
+                    username = x.Username,
691
+                    calltype = Enum.Parse(typeof(EnumTalkRecordsCallType), x.CallType.ToString()).ToString(),
692
+                    talktime = x.TalkTime > 0 ? x.TalkTime.ToString() : "0",
693
+                    qcstate = x.QCState == 0 ? "未质检" : "已质检",
694
+                    qcscore = x.QCScore,
695
+                    qcremark = x.QCRemark ?? "",
696
+                    qcuserid = x.QCUserId?.ToString() ?? "",
697
+                    qcusername = x.QCUserName ?? "",
698
+                    qctime = x.QCTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? ""
699
+                }),
700
+                total = recordCount
701
+            };
702
+            return Content(obj.ToJson());
703
+        }
704
+
705
+        /// <summary>
706
+        /// 已质检列表
707
+        /// </summary>
708
+        /// <returns></returns>
709
+        public ActionResult GetAutoCallYZJList(FilterTalkRecord filter)
710
+        {
711
+            var sort = "ORDER BY startdate desc";
712
+            if (!string.IsNullOrWhiteSpace(filter.SortField))
713
+            {
714
+                var arr = filter.SortField.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
715
+                EnumTalkRecordsSortField e;
716
+                if (!Enum.TryParse(arr[0], out e))
717
+                    return Error("排序字段参数错误");
718
+                sort = "ORDER BY " + e.ToString() + " " + arr[1];
719
+            }
720
+
721
+            StringBuilder where = new StringBuilder();
722
+
723
+
724
+            if (!string.IsNullOrWhiteSpace(filter.UserCode))
725
+            {
726
+                where.Append(" and agentid=" + filter.UserCode);
727
+            }
728
+            if (!string.IsNullOrWhiteSpace(filter.Phone))
729
+            {
730
+                where.Append(" and callee like '%" + filter.Phone + "%'");
731
+            }
732
+
733
+            if (!string.IsNullOrWhiteSpace(filter.TalkTime))
734
+            {
735
+                var arr = filter.TalkTime.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
736
+                if (arr.Length == 2)
737
+                {
738
+                    if (arr[0] == "1")
739
+                    {
740
+                        where.Append(" and talktime>" + arr[1]);
741
+                    }
742
+                    else if (arr[0] == "2")
743
+                    {
744
+                        where.Append(" and talktime=" + arr[1]);
745
+                    }
746
+                    else if (arr[0] == "3")
747
+                    {
748
+                        where.Append(" and talktime<" + arr[1]);
749
+                    }
750
+                    else { }
751
+                }
752
+            }
753
+
754
+            if (filter.StartTime == null || filter.EndTime == null)
755
+            {
756
+                filter.StartTime = DateTools.FirstSecondOfOneDay(DateTime.Now);
757
+                filter.EndTime = DateTools.LastSecondOfOneDay(DateTime.Now);
758
+            }
759
+            //qcstate=1 = 已质检;  qcstate=0 =未质检
760
+            //calltype  全部=0;未转坐席 = 1; 被叫接通转坐席未接 = 2; 转坐席且接通 = 3,
761
+            where.Append(" and qcstate=1   and calltype in (2,3)   and datediff(s,'" + filter.StartTime + "',StartDate)>=0 and datediff(s,EndDate,'" + filter.EndTime + "')>=0 ");
762
+
763
+            int recordCount = 0;
764
+            Model.PageData<Model.CallResult> pageModel = new Model.PageData<Model.CallResult>();
765
+            StringBuilder fields = new StringBuilder();
766
+            var dt = BLL.PagerBLL.GetListPager(
767
+                       "V_AutoCallResult",
768
+                       "Id",
769
+                       "id,itemid,taskname, callee, agentid, username,startdate,enddate,getinagentdate,calltype,talktime,RecordPath, QCState, QCScore, QCRemark, QCUserId, QCUserName,QCTime",
770
+                       where.ToString(),
771
+                       sort,
772
+                       filter.PageSize,
773
+                       filter.PageIndex,
774
+                       true,
775
+                       out recordCount);
776
+            var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
777
+            var callResultList = callResultBLL.DataTableToListQC(dt);
778
+
779
+            var obj = new
780
+            {
781
+                rows = callResultList.Select(x => new
782
+                {
783
+                    id = x.Id,
784
+                    taskid = x.TaskId,
785
+                    callnumber = x.CallNumber,
786
+                    usercode = x.Usercode == "0" ? "" : x.Usercode,
787
+                    startdate = x.StartDate?.ToString("yyyy-MM-dd HH:mm:ss") ?? "",
788
+                    getinagentdate = x.GetInAgentDate?.ToString("yyyy-MM-dd HH:mm:ss") ?? "",
789
+                    enddate = x.EndDate?.ToString("yyyy-MM-dd HH:mm:ss") ?? "",
790
+                    username = x.Username,
791
+                    calltype = Enum.Parse(typeof(EnumTalkRecordsCallType), x.CallType.ToString()).ToString(),
792
+                    talktime = x.TalkTime > 0 ? x.TalkTime.ToString() : "0",
793
+                    qcstate = x.QCState == 0 ? "未质检" : "已质检",
794
+                    qcscore = x.QCScore,
795
+                    qcremark = x.QCRemark ?? "",
796
+                    qcuserid = x.QCUserId?.ToString() ?? "",
797
+                    qcusername = x.QCUserName ?? "",
798
+                    qctime = x.QCTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? ""
799
+                }),
800
+                total = recordCount
801
+            };
802
+            return Content(obj.ToJson());
803
+        }
804
+
805
+        /// <summary>
806
+        /// 获取质检详情
807
+        /// </summary>
808
+        /// <param name="id"></param>
809
+        /// <returns></returns>
810
+        public ActionResult GetQCDetail(string id)
811
+        {
812
+
813
+            DataTable dt = new DataTable();
814
+            DataTable dtindex = new DataTable();
815
+            DataTable dtres = new DataTable();
816
+            try
817
+            {
818
+                dt = new BLL.T_QC_IndexCategory().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
819
+                dtindex = new BLL.T_QC_IndexBase().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
820
+                dtres = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + id + " ").Tables[0];
821
+                int i = 0;
822
+                int m = 0;
823
+                int indexcount = 0;
824
+                int allscore = 0;
825
+                int childscore = 0;
826
+                int childpf = 0;
827
+                int allpf = 0;
828
+                List<Model.QCModel> qclist = new List<Model.QCModel>();
829
+                object obj = null;
830
+
831
+                foreach (DataRow dr in dt.Select("F_ParentId=0"))
832
+                {
833
+                    Model.QCModel qcml = new Model.QCModel();
834
+                    List<Model.QCModel> qcclist = new List<Model.QCModel>();
835
+
836
+                    i = 0;
837
+                    indexcount = 0;
838
+                    childscore = 0;
839
+                    childpf = 0;
840
+
841
+                    string categoryid = dr["F_CategoryId"].ToString().Trim();
842
+
843
+                    qcml.Qcid = categoryid;
844
+                    qcml.Qcname = dr["F_CategoryName"].ToString().Trim();
845
+
846
+                    obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId in(select F_CategoryId from T_QC_IndexCategory where F_ParentId=" + dr["F_CategoryId"] + ")");
847
+                    qcml.Rowspan = obj.ToString();
848
+                    foreach (DataRow childdr in dt.Select("F_ParentId=" + categoryid + ""))
849
+                    {
850
+                        Model.QCModel qcmlc = new Model.QCModel();
851
+                        List<Model.QCModel> qccrlist = new List<Model.QCModel>();
852
+                        m = 0;
853
+                        #region 子分类
854
+                        string childcategoryid = childdr["F_CategoryId"].ToString().Trim();
855
+                        DataRow[] arrchild = dtindex.Select("F_CategoryId=" + childcategoryid + "");
856
+                        indexcount += arrchild.Length;
857
+
858
+                        //加载项
859
+                        qcmlc.Qcid = categoryid + "-" + childcategoryid;
860
+                        qcmlc.Qcname = childdr["F_CategoryName"].ToString().Trim();
861
+                        obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId=" + childdr["F_CategoryId"]);
862
+                        qcmlc.Rowspan = obj.ToString();
863
+                        #endregion
864
+                        foreach (DataRow indexdr in arrchild)
865
+                        {
866
+                            Model.QCModel qcmlcr = new Model.QCModel();
867
+                            string indexid = indexdr["F_IndexId"].ToString().Trim();
868
+                            string pf = "0";
869
+                            try
870
+                            {
871
+                                //分类分数合计
872
+                                childscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
873
+                                //总计合计
874
+                                allscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
875
+                            }
876
+                            catch
877
+                            { }
878
+                            try
879
+                            {
880
+                                pf = dtres.Select("F_IndexId=" + indexid + "")[0]["F_QCScore"].ToString().Trim();
881
+                                childpf += Convert.ToInt32(pf);//分类评分合计
882
+                                allpf += Convert.ToInt32(pf);//评分总计
883
+                            }
884
+                            catch
885
+                            {
886
+                            }
887
+
888
+                            #region 指标
889
+                            //加载指标
890
+                            qcmlcr.Qcid = categoryid + "-" + childcategoryid + "-" + indexid;
891
+                            qcmlcr.Qcname = indexdr["F_Title"].ToString().Trim();
892
+                            qcmlcr.Qcscore = indexdr["F_Score"].ToString().Trim();
893
+                            qcmlcr.Qcpf = pf;
894
+                            qcmlcr.Rowspan = "0";
895
+                            qcmlcr.Colspan = "0";
896
+                            #endregion
897
+                            m++;
898
+
899
+                            qccrlist.Add(qcmlcr);
900
+
901
+                        }
902
+                        i++;
903
+                        qcmlc.Qclist = qccrlist;
904
+                        qcclist.Add(qcmlc);
905
+                    }
906
+                    //合计
907
+                    qcml.Qcscore = childscore.ToString().Trim();
908
+                    qcml.Qcpf = childpf.ToString().Trim();
909
+                    qcml.Qclist = qcclist;
910
+                    qcml.Colspan = "2";
911
+                    qclist.Add(qcml);
912
+                }
913
+                Model.QCModel qcmlhj = new Model.QCModel();
914
+                qcmlhj.Qcid = "0";
915
+                qcmlhj.Qcname = "总计";
916
+                qcmlhj.Qcscore = allscore.ToString().Trim();
917
+                qcmlhj.Qcpf = allpf.ToString().Trim();
918
+                qcmlhj.Qclist = qclist;
919
+                qcmlhj.Colspan = "3";
920
+
921
+                return Success("质检部分加载成功", qcmlhj);
922
+            }
923
+            catch (Exception ex)
924
+            {
925
+                return Error("获取质检详情异常,错误:" + ex.ToString());
926
+            }
927
+            finally
928
+            {
929
+                dtres.Clear();
930
+                dtres.Dispose();
931
+                dtindex.Clear();
932
+                dtindex.Dispose();
933
+                dt.Clear();
934
+                dt.Dispose();
935
+            }
936
+        }
937
+
938
+        /// <summary>
939
+        /// 保存质检详情
940
+        /// </summary>
941
+        /// <param name="id"></param>
942
+        /// <param name="xmlinfo"></param>
943
+        /// <returns></returns>
944
+        public ActionResult SaveQCDetail(string id, string xmlinfo)
945
+        {
946
+
947
+            DataTable dt = new BLL.T_QC_IndexResAutoCall().GetList(" CallRecordsId=" + id + " ").Tables[0];
948
+            int allscore = 0;
949
+            foreach (string scoreinfo in xmlinfo.Trim(';').Split(';'))
950
+            {
951
+                //判断存在该指标评估则修改,无则添加
952
+                string idsss = scoreinfo.Split(':')[0];
953
+                string indexid = idsss.Split('-')[2];
954
+                if (dt.Select(" F_IndexId=" + indexid + " ").Length > 0)
955
+                {
956
+                    Model.T_QC_IndexResAutoCall model = new Model.T_QC_IndexResAutoCall();
957
+                    model.F_Id = Convert.ToInt32(dt.Select(" F_IndexId=" + indexid + " ")[0]["F_Id"].ToString());
958
+                    model.CallRecordsId = Convert.ToInt32(id);
959
+                    try
960
+                    {
961
+                        model.F_IndexId = Convert.ToInt32(indexid);
962
+                    }
963
+                    catch
964
+                    { }
965
+                    try
966
+                    {
967
+                        model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
968
+                        allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
969
+                    }
970
+                    catch
971
+                    { }
972
+                    new BLL.T_QC_IndexResAutoCall().Update(model);
973
+                }
974
+                else
975
+                {
976
+                    Model.T_QC_IndexResAutoCall model = new Model.T_QC_IndexResAutoCall();
977
+                    model.CallRecordsId = Convert.ToInt32(id);
978
+                    try
979
+                    {
980
+                        model.F_IndexId = Convert.ToInt32(indexid);
981
+                    }
982
+                    catch
983
+                    { }
984
+                    try
985
+                    {
986
+                        model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
987
+                        allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
988
+                    }
989
+                    catch
990
+                    { }
991
+                    new BLL.T_QC_IndexResAutoCall().Add(model);
992
+                }
993
+            }
994
+
995
+            Model.CallResult callmodel = new Model.CallResult();
996
+            callmodel.Id = Convert.ToInt32(id);
997
+            callmodel.QCState = 1;
998
+            callmodel.QCScore = allscore;
999
+            callmodel.QCUserId = CurrentUser.UserData.F_UserId;
1000
+            callmodel.QCUserCode = CurrentUser.UserData.F_UserCode;
1001
+            callmodel.QCUserName = CurrentUser.UserData.F_UserName;
1002
+            callmodel.QCTime = DateTime.Now;
1003
+            callmodel.QCRemark = "";
1004
+
1005
+            //callmodel.F_QCIsSelect = 0;
1006
+            //callmodel.F_QCQuestion = question;
1007
+            //callmodel.F_QCAdvise = advise;
1008
+            if (new BLL.CallResult().UpdateQC(callmodel))
1009
+                return Error("保存质检评分信息失败");
1010
+            dt.Clear();
1011
+            dt.Dispose();
1012
+            return Success("保存成功");
1013
+        }
1014
+        #endregion
596 1015
     }
597 1016
 }

+ 2 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiWorkTotalController.cs

@@ -37,7 +37,8 @@ namespace CallCenterApi.Interface.Controllers.report
37 37
             ActionResult res = NoToken("未知错误,请重新登录");
38 38
 
39 39
             DataTable dtNew = new DataTable();
40
-            dtNew = getData(stime, endtime, dpt, dayss, usercode, extensionnumber);
40
+            List<int> indexs = new List<int>();
41
+            dtNew = getData(stime, endtime, dpt, dayss, usercode, extensionnumber, indexs);
41 42
             res = Success("获取坐席工作统计数据成功", dtNew);
42 43
 
43 44
             return res;

+ 1 - 0
CallCenterApi/CallCenterApi.Model/CallCenterApi.Model.csproj

@@ -86,6 +86,7 @@
86 86
     <Compile Include="T_QC_IndexBase.cs" />
87 87
     <Compile Include="T_QC_IndexCategory.cs" />
88 88
     <Compile Include="T_QC_IndexRes.cs" />
89
+    <Compile Include="T_QC_IndexResAutoCall.cs" />
89 90
     <Compile Include="T_RegionCategory.cs" />
90 91
     <Compile Include="T_RepositoryCategory.cs" />
91 92
     <Compile Include="T_RepositoryInformation.cs" />

+ 28 - 0
CallCenterApi/CallCenterApi.Model/CallResult.cs

@@ -52,6 +52,34 @@ namespace CallCenterApi.Model
52 52
         /// 通话时长
53 53
         /// </summary>
54 54
         public int TalkTime { get; set; }
55
+        /// <summary>
56
+        /// 质检状态(1=已质检; 0=未质检)
57
+        /// </summary>
58
+        public int QCState { get; set; }
59
+        /// <summary>
60
+        /// 质检总分数
61
+        /// </summary>
62
+        public int QCScore { get; set; }
63
+        /// <summary>
64
+        /// 质检备注
65
+        /// </summary>
66
+        public string QCRemark { get; set; }
67
+        /// <summary>
68
+        /// 质检用户ID
69
+        /// </summary>
70
+        public int? QCUserId { get; set; }
71
+        /// <summary>
72
+        /// 质检用户工号
73
+        /// </summary>
74
+        public string QCUserCode { get; set; }
75
+        /// <summary>
76
+        /// 质检用户名
77
+        /// </summary>
78
+        public string QCUserName { get; set; }
79
+        /// <summary>
80
+        /// 质检时间
81
+        /// </summary>
82
+        public DateTime? QCTime { get; set; }
55 83
 
56 84
     }
57 85
 }

+ 74 - 0
CallCenterApi/CallCenterApi.Model/T_QC_IndexResAutoCall.cs

@@ -0,0 +1,74 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace CallCenterApi.Model
8
+{
9
+    /// <summary>
10
+    /// T_QC_IndexResAutoCall:实体类(属性说明自动提取数据库字段的描述信息)
11
+    /// </summary>
12
+    [Serializable]
13
+    public partial class T_QC_IndexResAutoCall
14
+    {
15
+        public T_QC_IndexResAutoCall()
16
+        { }
17
+        #region Model
18
+        private int _f_id;
19
+        private int? _callrecordsid;
20
+        private int? _f_indexid;
21
+        private int? _f_score = 0;
22
+        private int? _f_qcscore = 0;
23
+        private string _f_remark;
24
+        /// <summary>
25
+        /// 质检结果Id
26
+        /// </summary>
27
+        public int F_Id
28
+        {
29
+            set { _f_id = value; }
30
+            get { return _f_id; }
31
+        }
32
+        /// <summary>
33
+        /// 通话记录Id
34
+        /// </summary>
35
+        public int? CallRecordsId
36
+        {
37
+            set { _callrecordsid = value; }
38
+            get { return _callrecordsid; }
39
+        }
40
+        /// <summary>
41
+        /// 指标Id
42
+        /// </summary>
43
+        public int? F_IndexId
44
+        {
45
+            set { _f_indexid = value; }
46
+            get { return _f_indexid; }
47
+        }
48
+        /// <summary>
49
+        /// 指标分值
50
+        /// </summary>
51
+        public int? F_Score
52
+        {
53
+            set { _f_score = value; }
54
+            get { return _f_score; }
55
+        }
56
+        /// <summary>
57
+        /// 质检分值
58
+        /// </summary>
59
+        public int? F_QCScore
60
+        {
61
+            set { _f_qcscore = value; }
62
+            get { return _f_qcscore; }
63
+        }
64
+        /// <summary>
65
+        /// 指标备注
66
+        /// </summary>
67
+        public string F_Remark
68
+        {
69
+            set { _f_remark = value; }
70
+            get { return _f_remark; }
71
+        }
72
+        #endregion Model
73
+    }
74
+}