Przeglądaj źródła

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

zhengbingbing 8 lat temu
rodzic
commit
63e5fd9e00

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

217
         //{
217
         //{
218
         //return dal.GetList(PageSize,PageIndex,strWhere);
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
         #endregion  BasicMethod
229
         #endregion  BasicMethod
222
         #region  ExtensionMethod
230
         #region  ExtensionMethod
223
 
231
 

Plik diff jest za duży
+ 341 - 312
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs


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

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

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

700
             return DbHelperSQL.Query(strSql.ToString());
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
         #endregion  BasicMethod
726
         #endregion  BasicMethod
704
         #region  ExtensionMethod
727
         #region  ExtensionMethod
705
 
728
 

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

546
         {
546
         {
547
             StringBuilder strSql = new StringBuilder();
547
             StringBuilder strSql = new StringBuilder();
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 ");
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
             if (strWhere.Trim() != "")
550
             if (strWhere.Trim() != "")
551
             {
551
             {
552
                 strSql.Append(" where " + strWhere);
552
                 strSql.Append(" where " + strWhere);

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

177
         private object GetHWLSS()
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
             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 };
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
             var query3 = times.Select(x => {
185
             var query3 = times.Select(x => {
252
         private object GetHWZL()
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
             var hwcon = dt.Rows[0]["con"].ToString();//话务量
257
             var hwcon = dt.Rows[0]["con"].ToString();//话务量
258
             if (string.IsNullOrEmpty(hwcon))
258
             if (string.IsNullOrEmpty(hwcon))
260
                 hwcon = "0";
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
             var lhcon = dt1.Rows[0]["con"].ToString();//话务量
264
             var lhcon = dt1.Rows[0]["con"].ToString();//话务量
265
             if (string.IsNullOrEmpty(lhcon))
265
             if (string.IsNullOrEmpty(lhcon))
266
             {
266
             {
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
             var jtcon = dt2.Rows[0]["con"].ToString();//接通量
272
             var jtcon = dt2.Rows[0]["con"].ToString();//接通量
273
             var thtimes = dt2.Rows[0]["tltimes"].ToString();//通话时长
273
             var thtimes = dt2.Rows[0]["tltimes"].ToString();//通话时长
274
             if (string.IsNullOrEmpty(jtcon))
274
             if (string.IsNullOrEmpty(jtcon))
309
         private object GetHWL()
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
             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 };
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
             var query3 = times.Select(x =>
315
             var query3 = times.Select(x =>
332
         private object GetJTL()
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
             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 };
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
             var query3 = times.Select(x =>
341
             var query3 = times.Select(x =>
361
         private object GetPjthsc()
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
             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 };
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
             var query3 = times.Select(x => {
367
             var query3 = times.Select(x => {

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

495
             return res;
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
 }