Bladeren bron

Merge branch 'master' of http://192.168.1.222:3000/zhengbingbing/NewCallCenter5.1_API

zhengbingbing 8 jaren geleden
bovenliggende
commit
63e5fd9e00

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

@@ -217,7 +217,15 @@ namespace CallCenterApi.BLL
217 217
         //{
218 218
         //return dal.GetList(PageSize,PageIndex,strWhere);
219 219
         //}
220
-
220
+        /// <summary>
221
+        /// 根据工号获取坐席组
222
+        /// </summary>
223
+        /// <param name="strWhere"></param>
224
+        /// <returns></returns>
225
+        public string GetGroup(string strWhere)
226
+        {
227
+            return dal.GetGroup(strWhere);
228
+        }
221 229
         #endregion  BasicMethod
222 230
         #region  ExtensionMethod
223 231
 

File diff suppressed because it is too large
+ 341 - 312
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs


+ 4 - 4
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords_QC.cs

@@ -417,7 +417,7 @@ namespace CallCenterApi.DAL
417 417
         {
418 418
 
419 419
             StringBuilder strSql = new StringBuilder();
420
-            strSql.Append("select  top 1 * from T_Call_CallRecords ");
420
+            strSql.Append("select  top 1 * from T_Call_CallRecords  WHTH(NOLOCK)");
421 421
             strSql.Append(" where CallRecordsId=@CallRecordsId");
422 422
             SqlParameter[] parameters = {
423 423
                     new SqlParameter("@CallRecordsId", SqlDbType.Int,4)
@@ -642,7 +642,7 @@ namespace CallCenterApi.DAL
642 642
         {
643 643
             StringBuilder strSql = new StringBuilder();
644 644
             strSql.Append("select * ");
645
-            strSql.Append(" FROM T_Call_CallRecords ");
645
+            strSql.Append(" FROM T_Call_CallRecords  WHTH(NOLOCK)");
646 646
             if (strWhere.Trim() != "")
647 647
             {
648 648
                 strSql.Append(" where " + strWhere);
@@ -662,7 +662,7 @@ namespace CallCenterApi.DAL
662 662
                 strSql.Append(" top " + Top.ToString());
663 663
             }
664 664
             strSql.Append(" * ");
665
-            strSql.Append(" FROM T_Call_CallRecords ");
665
+            strSql.Append(" FROM T_Call_CallRecords  WHTH(NOLOCK)");
666 666
             if (strWhere.Trim() != "")
667 667
             {
668 668
                 strSql.Append(" where " + strWhere);
@@ -677,7 +677,7 @@ namespace CallCenterApi.DAL
677 677
         public int GetRecordCount(string strWhere)
678 678
         {
679 679
             StringBuilder strSql = new StringBuilder();
680
-            strSql.Append("select count(1) FROM T_Call_CallRecords ");
680
+            strSql.Append("select count(1) FROM T_Call_CallRecords  WHTH(NOLOCK)");
681 681
             if (strWhere.Trim() != "")
682 682
             {
683 683
                 strSql.Append(" where " + strWhere);

+ 23 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_UserAccount.cs

@@ -700,6 +700,29 @@ namespace CallCenterApi.DAL
700 700
             return DbHelperSQL.Query(strSql.ToString());
701 701
         }
702 702
 
703
+        /// <summary>
704
+        /// 根据工号获取坐席组
705
+        /// </summary>
706
+        /// <param name="strWhere"></param>
707
+        /// <returns></returns>
708
+        public string GetGroup(string strWhere)
709
+        {
710
+            StringBuilder strSql = new StringBuilder();
711
+            strSql.Append("SELECT TOP 1 F_SeartGroup FROM T_Sys_UserAccount ");
712
+            if (strWhere.Trim() != "")
713
+            {
714
+                strSql.Append(" where " + strWhere);
715
+            }
716
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
717
+            if (obj == null)
718
+            {
719
+                return "";
720
+            }
721
+            else
722
+            {
723
+                return Convert.ToString(obj);
724
+            }
725
+        }
703 726
         #endregion  BasicMethod
704 727
         #region  ExtensionMethod
705 728
 

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrder.cs

@@ -546,7 +546,7 @@ namespace CallCenterApi.DAL
546 546
         {
547 547
             StringBuilder strSql = new StringBuilder();
548 548
             strSql.Append("select ID,WorkOrderID,Type,TypeClass,Title,Detail,Files,ResponDept,ResponUser,CallID,CustomerID,Customer,CustomerTel,Province,City,County,Address,Source,Answer,State,LastDealUser,LastDealTime,IsReturn,LimitTime,IsReturnBak,ReturnBakTime,IsTimeOut,IsUserSend,IsAdminSend,CreateUser,CreateTime,IsDel,DelUser,DelTime,IsAudit,AuditState,AuditUser,AuditTime,AuditCont,AppointTime,Clcontent ");
549
-            strSql.Append(" FROM T_Wo_WorkOrder ");
549
+            strSql.Append(" FROM T_Wo_WorkOrder  WHTH(NOLOCK)");
550 550
             if (strWhere.Trim() != "")
551 551
             {
552 552
                 strSql.Append(" where " + strWhere);

+ 9 - 9
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/InfoController.cs

@@ -177,9 +177,9 @@ namespace CallCenterApi.Interface.Controllers
177 177
         private object GetHWLSS()
178 178
         {
179 179
             //接通量
180
-            DataTable dt = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor, count(1) con from T_Call_CallRecords where CallState=1 and datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
180
+            DataTable dt = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor, count(1) con from T_Call_CallRecords  WHTH(NOLOCK) where CallState=1 and datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
181 181
             //来电量
182
-            DataTable dt1 = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor, count(1) con from T_Call_CallRecords where CallType=0 and datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
182
+            DataTable dt1 = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor, count(1) con from T_Call_CallRecords  WHTH(NOLOCK) where CallType=0 and datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
183 183
 
184 184
             int[] times = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
185 185
             var query3 = times.Select(x => {
@@ -252,7 +252,7 @@ namespace CallCenterApi.Interface.Controllers
252 252
         private object GetHWZL()
253 253
         {
254 254
             //话务量
255
-            DataTable dt = DbHelperSQL.Query(" select count(1) con from T_Call_CallRecords where datediff(day, BeginTime, getdate()) = 0 ").Tables[0];
255
+            DataTable dt = DbHelperSQL.Query(" select count(1) con from T_Call_CallRecords  WHTH(NOLOCK) where datediff(day, BeginTime, getdate()) = 0 ").Tables[0];
256 256
 
257 257
             var hwcon = dt.Rows[0]["con"].ToString();//话务量
258 258
             if (string.IsNullOrEmpty(hwcon))
@@ -260,7 +260,7 @@ namespace CallCenterApi.Interface.Controllers
260 260
                 hwcon = "0";
261 261
             }
262 262
             //来话量
263
-            DataTable dt1 = DbHelperSQL.Query(" select count(1) con from T_Call_CallRecords where CallType=0 and datediff(day, BeginTime, getdate()) = 0 ").Tables[0];
263
+            DataTable dt1 = DbHelperSQL.Query(" select count(1) con from T_Call_CallRecords  WHTH(NOLOCK) where CallType=0 and datediff(day, BeginTime, getdate()) = 0 ").Tables[0];
264 264
             var lhcon = dt1.Rows[0]["con"].ToString();//话务量
265 265
             if (string.IsNullOrEmpty(lhcon))
266 266
             {
@@ -268,7 +268,7 @@ namespace CallCenterApi.Interface.Controllers
268 268
             }
269 269
 
270 270
             //接通量,通话时长
271
-            DataTable dt2 = DbHelperSQL.Query(" select count(1) con,sum(TalkLongTime) tltimes from T_Call_CallRecords where CallState=1 and datediff(day, BeginTime, getdate()) = 0 ").Tables[0];
271
+            DataTable dt2 = DbHelperSQL.Query(" select count(1) con,sum(TalkLongTime) tltimes from T_Call_CallRecords  WHTH(NOLOCK) where CallState=1 and datediff(day, BeginTime, getdate()) = 0 ").Tables[0];
272 272
             var jtcon = dt2.Rows[0]["con"].ToString();//接通量
273 273
             var thtimes = dt2.Rows[0]["tltimes"].ToString();//通话时长
274 274
             if (string.IsNullOrEmpty(jtcon))
@@ -309,7 +309,7 @@ namespace CallCenterApi.Interface.Controllers
309 309
         private object GetHWL()
310 310
         {
311 311
             //话务量
312
-            DataTable dt = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor,count(1) con from T_Call_CallRecords where datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
312
+            DataTable dt = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor,count(1) con from T_Call_CallRecords  WHTH(NOLOCK) where datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
313 313
             
314 314
             int[] times = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
315 315
             var query3 = times.Select(x =>
@@ -332,10 +332,10 @@ namespace CallCenterApi.Interface.Controllers
332 332
         private object GetJTL()
333 333
         {
334 334
             //话务量
335
-            DataTable dt = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor,count(1) con from T_Call_CallRecords where datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
335
+            DataTable dt = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor,count(1) con from T_Call_CallRecords  WHTH(NOLOCK) where datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
336 336
             
337 337
             //接通量,通话时长
338
-            DataTable dt2 = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor,count(1) con from T_Call_CallRecords where CallState=1 and datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
338
+            DataTable dt2 = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor,count(1) con from T_Call_CallRecords  WHTH(NOLOCK) where CallState=1 and datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
339 339
             
340 340
             int[] times = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
341 341
             var query3 = times.Select(x =>
@@ -361,7 +361,7 @@ namespace CallCenterApi.Interface.Controllers
361 361
         private object GetPjthsc()
362 362
         {
363 363
             //接通量,通话时长
364
-            DataTable dt = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor,count(1) con,sum(TalkLongTime) tltimes from T_Call_CallRecords where CallState=1 and datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
364
+            DataTable dt = DbHelperSQL.Query(" select datepart(hh,BeginTime) hor,count(1) con,sum(TalkLongTime) tltimes from T_Call_CallRecords  WHTH(NOLOCK) where CallState=1 and datediff(day, BeginTime, getdate()) = 0 group by datepart(hh,BeginTime) ").Tables[0];
365 365
 
366 366
             int[] times = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
367 367
             var query3 = times.Select(x => {

+ 16 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

@@ -495,5 +495,21 @@ namespace CallCenterApi.Interface.Controllers
495 495
             return res;
496 496
         }
497 497
 
498
+        //根据工号获取坐席组号
499
+        public ActionResult GetSeatGroup(string worknum)
500
+        {
501
+            ActionResult res = NoToken("未知错误,请重新登录");
502
+            if (Request.IsAuthenticated)
503
+            {
504
+                string strwhere = "";
505
+                if (worknum != "")
506
+                {
507
+                    strwhere = " F_WorkNumber='" + worknum + "'";
508
+                }
509
+                string setgroup = sysUserAccountBll.GetGroup(strwhere);
510
+                res = Success("坐席组号获取成功", setgroup);
511
+            }
512
+            return res;
513
+        }
498 514
     }
499 515
 }