|
|
@@ -216,7 +216,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
216
|
216
|
/// 获取当月/当天的工单量(已完成,未完成)
|
|
217
|
217
|
/// </summary>
|
|
218
|
218
|
/// <returns></returns>
|
|
219
|
|
- public ActionResult GetWorkTotal()
|
|
|
219
|
+ public ActionResult GetWorkTotalOLD()
|
|
220
|
220
|
{
|
|
221
|
221
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
222
|
222
|
if (Request.IsAuthenticated)
|
|
|
@@ -284,6 +284,77 @@ namespace CallCenterApi.Interface.Controllers
|
|
284
|
284
|
}
|
|
285
|
285
|
|
|
286
|
286
|
/// <summary>
|
|
|
287
|
+ /// 获取当月/当天的工单量(已完成,未完成)
|
|
|
288
|
+ /// </summary>
|
|
|
289
|
+ /// <returns></returns>
|
|
|
290
|
+ public ActionResult GetWorkTotal()
|
|
|
291
|
+ {
|
|
|
292
|
+ ActionResult res = NoToken("未知错误,请重新登录");
|
|
|
293
|
+ if (Request.IsAuthenticated)
|
|
|
294
|
+ {
|
|
|
295
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
296
|
+ int deptid = CurrentUser.UserData.F_DeptId; //部门id
|
|
|
297
|
+ if (userId != 0)
|
|
|
298
|
+ {
|
|
|
299
|
+ Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
300
|
+ if (ua != null)
|
|
|
301
|
+ {
|
|
|
302
|
+ var date = DateTime.Now;//DateTime.Parse("2015-04-14"); //
|
|
|
303
|
+ string strDate = date.ToString("yyyy-MM-dd");
|
|
|
304
|
+ string strMonth = date.ToString("yyyy-MM");
|
|
|
305
|
+
|
|
|
306
|
+ //BLL.T_Wo_WorkOrderBase bll = new BLL.T_Wo_WorkOrderBase();
|
|
|
307
|
+ //var list1 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
|
|
|
308
|
+ //var list2 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
|
|
|
309
|
+ //var list3 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
|
|
|
310
|
+ //var list4 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
|
|
|
311
|
+ //部门信息
|
|
|
312
|
+ var modelDep = new BLL.T_Sys_Department().GetModel(deptid);
|
|
|
313
|
+ int depType = 0;
|
|
|
314
|
+ if (modelDep != null)
|
|
|
315
|
+ depType = modelDep.F_Type ?? 0; //部门操作权限:1接待部,2办理人员,3区域客服,4监管
|
|
|
316
|
+
|
|
|
317
|
+ string uwhere = " 1=1 ";
|
|
|
318
|
+ if (ua.F_RoleId != 17 && depType != 1 && depType != 3)
|
|
|
319
|
+ {
|
|
|
320
|
+ uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
|
|
|
321
|
+ }
|
|
|
322
|
+
|
|
|
323
|
+ BLL.T_Wo_WorkOrderNew bll = new BLL.T_Wo_WorkOrderNew();
|
|
|
324
|
+ var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and F_State =" + (int)EnumWorkOrderState.finish + " and IsDelete=0 ").Tables[0];
|
|
|
325
|
+ var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and F_State <" + (int)EnumWorkOrderState.finish + " and IsDelete=0 ").Tables[0];
|
|
|
326
|
+ var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and F_State =" + (int)EnumWorkOrderState.finish + " and IsDelete=0 ").Tables[0];
|
|
|
327
|
+ var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and F_State <" + (int)EnumWorkOrderState.finish + " and IsDelete=0 ").Tables[0];
|
|
|
328
|
+ #region
|
|
|
329
|
+ //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =2 and IsDel=0 ").Tables[0];
|
|
|
330
|
+ //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State in (0,1) and IsDel=0 ").Tables[0];
|
|
|
331
|
+ //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =2 and IsDel=0 ").Tables[0];
|
|
|
332
|
+ //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State in (0,1) and IsDel=0 ").Tables[0];
|
|
|
333
|
+
|
|
|
334
|
+ ////日已完成
|
|
|
335
|
+ //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =1 and IsDel=0 ").Tables[0];
|
|
|
336
|
+ ////日未完成
|
|
|
337
|
+ //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State=0 and IsDel=0 ").Tables[0];
|
|
|
338
|
+ ////月已完成
|
|
|
339
|
+ //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =1 and IsDel=0 ").Tables[0];
|
|
|
340
|
+ ////月未完成
|
|
|
341
|
+ //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State=0 and IsDel=0 ").Tables[0];
|
|
|
342
|
+ #endregion
|
|
|
343
|
+ var obj = new
|
|
|
344
|
+ {
|
|
|
345
|
+ daywc = list1.Rows.Count,
|
|
|
346
|
+ daywwc = list2.Rows.Count,
|
|
|
347
|
+ monwc = list3.Rows.Count,
|
|
|
348
|
+ monwwc = list4.Rows.Count
|
|
|
349
|
+ };
|
|
|
350
|
+ res = Success("成功", obj);
|
|
|
351
|
+ }
|
|
|
352
|
+ }
|
|
|
353
|
+ }
|
|
|
354
|
+ return res;
|
|
|
355
|
+ }
|
|
|
356
|
+
|
|
|
357
|
+ /// <summary>
|
|
287
|
358
|
/// 当天每小时的总通话量和接通量
|
|
288
|
359
|
/// </summary>
|
|
289
|
360
|
/// <returns></returns>
|
|
|
@@ -362,7 +433,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
362
|
433
|
List<string> cols = strcols.Take(days).ToList();
|
|
363
|
434
|
BLL.T_Call_CallRecords telbll = new BLL.T_Call_CallRecords();
|
|
364
|
435
|
//BLL.T_Wo_WorkOrderBase workbll = new BLL.T_Wo_WorkOrderBase();
|
|
365
|
|
- BLL.T_Wo_WorkOrder workbll = new BLL.T_Wo_WorkOrder();
|
|
|
436
|
+ BLL.T_Wo_WorkOrderNew workbll = new BLL.T_Wo_WorkOrderNew();
|
|
366
|
437
|
int[] teltotal = new int[days];
|
|
367
|
438
|
int[] worktotal = new int[days];
|
|
368
|
439
|
//部门信息
|
|
|
@@ -619,6 +690,8 @@ namespace CallCenterApi.Interface.Controllers
|
|
619
|
690
|
return res;
|
|
620
|
691
|
}
|
|
621
|
692
|
|
|
|
693
|
+
|
|
|
694
|
+
|
|
622
|
695
|
/// <summary>
|
|
623
|
696
|
/// 最近通话记录
|
|
624
|
697
|
/// </summary>
|