Przeglądaj źródła

调整工单后bug

zhengbingbing 6 lat temu
rodzic
commit
b8cbe34885

+ 126 - 122
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs

@@ -228,55 +228,56 @@ namespace CallCenterApi.Interface.Controllers
228 228
                     Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
229 229
                     if (ua != null)
230 230
                     {
231
-                        var date = DateTime.Now;//DateTime.Parse("2015-04-14"); //
232
-                        string strDate = date.ToString("yyyy-MM-dd");
233
-                        string strMonth = date.ToString("yyyy-MM");
234
-
235
-                        //BLL.T_Wo_WorkOrderBase bll = new BLL.T_Wo_WorkOrderBase();
236
-                        //var list1 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
237
-                        //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];
238
-                        //var list3 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
239
-                        //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];
240
-                        //部门信息
241
-                        var modelDep = new BLL.T_Sys_Department().GetModel(deptid);
242
-                        int depType = 0;
243
-                        if (modelDep != null)
244
-                            depType = modelDep.F_Type ?? 0;  //部门操作权限:1接待部,2办理人员,3区域客服,4监管
245
-
246
-                        string uwhere = " 1=1 ";
247
-                        if (ua.F_RoleId != 17 && depType != 1 && depType != 3)
248
-                        {
249
-                            uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
250
-                        }
231
+                        //var date = DateTime.Now;//DateTime.Parse("2015-04-14"); //
232
+                        //string strDate = date.ToString("yyyy-MM-dd");
233
+                        //string strMonth = date.ToString("yyyy-MM");
234
+
235
+                        ////BLL.T_Wo_WorkOrderBase bll = new BLL.T_Wo_WorkOrderBase();
236
+                        ////var list1 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
237
+                        ////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];
238
+                        ////var list3 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
239
+                        ////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];
240
+                        ////部门信息
241
+                        //var modelDep = new BLL.T_Sys_Department().GetModel(deptid);
242
+                        //int depType = 0;
243
+                        //if (modelDep != null)
244
+                        //    depType = modelDep.F_Type ?? 0;  //部门操作权限:1接待部,2办理人员,3区域客服,4监管
251 245
 
252
-                        BLL.T_Wo_WorkOrder bll = new BLL.T_Wo_WorkOrder();
253
-                        var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
254
-                        var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State <" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
255
-                        var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
256
-                        var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State <" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
257
-                        #region
258
-                        //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =2 and IsDel=0 ").Tables[0];
259
-                        //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State in (0,1) and IsDel=0 ").Tables[0];
260
-                        //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =2 and IsDel=0 ").Tables[0];
261
-                        //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State in (0,1) and IsDel=0 ").Tables[0];
262
-
263
-                        ////日已完成
264
-                        //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =1 and IsDel=0 ").Tables[0];
265
-                        ////日未完成
266
-                        //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State=0 and IsDel=0 ").Tables[0];
267
-                        ////月已完成
268
-                        //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =1 and IsDel=0 ").Tables[0];
269
-                        ////月未完成
270
-                        //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State=0 and IsDel=0 ").Tables[0];
271
-                        #endregion
272
-                        var obj = new
273
-                        {
274
-                            daywc = list1.Rows.Count,
275
-                            daywwc = list2.Rows.Count,
276
-                            monwc = list3.Rows.Count,
277
-                            monwwc = list4.Rows.Count
278
-                        };
279
-                        res = Success("成功", obj);
246
+                        //string uwhere = " 1=1 ";
247
+                        //if (ua.F_RoleId != 17 && depType != 1 && depType != 3)
248
+                        //{
249
+                        //    uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
250
+                        //}
251
+
252
+                        //BLL.T_Wo_WorkOrder bll = new BLL.T_Wo_WorkOrder();
253
+                        //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
254
+                        //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State <" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
255
+                        //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
256
+                        //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State <" + (int)EnumWorkOrderState.finish + " and IsDel=0 ").Tables[0];
257
+                        //#region
258
+                        ////var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =2 and IsDel=0 ").Tables[0];
259
+                        ////var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State in (0,1) and IsDel=0 ").Tables[0];
260
+                        ////var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =2 and IsDel=0 ").Tables[0];
261
+                        ////var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State in (0,1) and IsDel=0 ").Tables[0];
262
+
263
+                        //////日已完成
264
+                        ////var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =1 and IsDel=0 ").Tables[0];
265
+                        //////日未完成
266
+                        ////var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State=0 and IsDel=0 ").Tables[0];
267
+                        //////月已完成
268
+                        ////var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =1 and IsDel=0 ").Tables[0];
269
+                        //////月未完成
270
+                        ////var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State=0 and IsDel=0 ").Tables[0];
271
+                        //#endregion
272
+                        //var obj = new
273
+                        //{
274
+                        //    daywc = list1.Rows.Count,
275
+                        //    daywwc = list2.Rows.Count,
276
+                        //    monwc = list3.Rows.Count,
277
+                        //    monwwc = list4.Rows.Count
278
+                        //};
279
+                        //res = Success("成功", obj);
280
+                        res = Success("成功");
280 281
                     }
281 282
                 }
282 283
             }
@@ -350,86 +351,88 @@ namespace CallCenterApi.Interface.Controllers
350 351
                     Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
351 352
                     if (ua != null)
352 353
                     {
353
-                        var date = DateTime.Now;//DateTime.Parse("2015-04-05"); //
354
-                        string strDate = date.ToString("yyyy-MM");
355
-
356
-                        int days = DateTime.DaysInMonth(date.Year, date.Month);
357
-
358
-                        string[] strcols = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
359
-                                  "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
360
-                                  "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" };
361
-                        int newcount = 0;
362
-                        List<string> cols = strcols.Take(days).ToList();
363
-                        BLL.T_Call_CallRecords telbll = new BLL.T_Call_CallRecords();
364
-                        //BLL.T_Wo_WorkOrderBase workbll = new BLL.T_Wo_WorkOrderBase();
365
-                        BLL.T_Wo_WorkOrder workbll = new BLL.T_Wo_WorkOrder();
366
-                        int[] teltotal = new int[days];
367
-                        int[] worktotal = new int[days];
368
-                        //部门信息
369
-                        var modelDep = new BLL.T_Sys_Department().GetModel(deptid);
370
-                        int depType = 0;
371
-                        if (modelDep != null)
372
-                            depType = modelDep.F_Type ?? 0;  //部门操作权限:1接待部,2办理人员,3区域客服,4监管
373
-
374
-                        string uwhere = " 1=1 ";
375
-                        string u1where = " 1=1 ";
376
-                        if (ua.F_RoleId != 17 && depType != 1 && depType != 3)
377
-                        {
378
-                            uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
379
-                            u1where += " and UserCode='" + ua.F_UserCode + "' ";
380
-                        }
354
+                        //    var date = DateTime.Now;//DateTime.Parse("2015-04-05"); //
355
+                        //    string strDate = date.ToString("yyyy-MM");
356
+
357
+                        //    int days = DateTime.DaysInMonth(date.Year, date.Month);
358
+
359
+                        //    string[] strcols = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
360
+                        //              "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
361
+                        //              "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" };
362
+                        //    int newcount = 0;
363
+                        //    List<string> cols = strcols.Take(days).ToList();
364
+                        //    BLL.T_Call_CallRecords telbll = new BLL.T_Call_CallRecords();
365
+                        //    //BLL.T_Wo_WorkOrderBase workbll = new BLL.T_Wo_WorkOrderBase();
366
+                        //    BLL.T_Wo_WorkOrder workbll = new BLL.T_Wo_WorkOrder();
367
+                        //    int[] teltotal = new int[days];
368
+                        //    int[] worktotal = new int[days];
369
+                        //    //部门信息
370
+                        //    var modelDep = new BLL.T_Sys_Department().GetModel(deptid);
371
+                        //    int depType = 0;
372
+                        //    if (modelDep != null)
373
+                        //        depType = modelDep.F_Type ?? 0;  //部门操作权限:1接待部,2办理人员,3区域客服,4监管
374
+
375
+                        //    string uwhere = " 1=1 ";
376
+                        //    string u1where = " 1=1 ";
377
+                        //    if (ua.F_RoleId != 17 && depType != 1 && depType != 3)
378
+                        //    {
379
+                        //        uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
380
+                        //        u1where += " and UserCode='" + ua.F_UserCode + "' ";
381
+                        //    }
381 382
 
382
-                        for (int i = 0; i < cols.Count; i++)
383
-                        {
384
-                            //var tellist = telbll.GetModelList(" UserId='" + userId + "' and CONVERT(varchar(10),BeginTime, 23)='" + (strDate + "-" + cols[i]) + "' ");
385
-                            var tellist = telbll.GetModelList(u1where + " and CONVERT(varchar(10),BeginTime, 23)='" + (strDate + "-" + cols[i]) + "' ");
386
-                            teltotal[i] = tellist.Count;
387
-                            newcount = newcount + tellist.Count;
388
-                            //var worklist = workbll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + (strDate + "-" + cols[i]) + "' ").Tables[0];
389
-                            var worklist = workbll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + (strDate + "-" + cols[i]) + "' ").Tables[0];
390
-                            worktotal[i] = worklist.Rows.Count;
391
-                        }
383
+                        //    for (int i = 0; i < cols.Count; i++)
384
+                        //    {
385
+                        //        //var tellist = telbll.GetModelList(" UserId='" + userId + "' and CONVERT(varchar(10),BeginTime, 23)='" + (strDate + "-" + cols[i]) + "' ");
386
+                        //        var tellist = telbll.GetModelList(u1where + " and CONVERT(varchar(10),BeginTime, 23)='" + (strDate + "-" + cols[i]) + "' ");
387
+                        //        teltotal[i] = tellist.Count;
388
+                        //        newcount = newcount + tellist.Count;
389
+                        //        //var worklist = workbll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + (strDate + "-" + cols[i]) + "' ").Tables[0];
390
+                        //        var worklist = workbll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + (strDate + "-" + cols[i]) + "' ").Tables[0];
391
+                        //        worktotal[i] = worklist.Rows.Count;
392
+                        //    }
392 393
 
393
-                        var olddate = date.AddYears(-1);
394
-                        string strold1 = olddate.ToString("yyyy-MM") + "-1";
395
-                        string strold2 = olddate.ToString("yyyy-MM-dd");
394
+                        //    var olddate = date.AddYears(-1);
395
+                        //    string strold1 = olddate.ToString("yyyy-MM") + "-1";
396
+                        //    string strold2 = olddate.ToString("yyyy-MM-dd");
396 397
 
397
-                        string bl = string.Empty;
398
-                        var oldcount = telbll.GetModelList(u1where + " and CONVERT(varchar(10),BeginTime, 23)>='" + strold1 + "' and CONVERT(varchar(10),BeginTime, 23)<='" + strold2 + "' ").Count;
398
+                        //    string bl = string.Empty;
399
+                        //    var oldcount = telbll.GetModelList(u1where + " and CONVERT(varchar(10),BeginTime, 23)>='" + strold1 + "' and CONVERT(varchar(10),BeginTime, 23)<='" + strold2 + "' ").Count;
399 400
 
400
-                        if (oldcount == newcount)
401
-                        {
402
-                            bl = " 持平";
403
-                        }
404
-                        else
405
-                        {
406
-                            if (newcount != 0)
407
-                            {
408
-                                if (oldcount > newcount)
409
-                                {
410
-                                    bl = " ↓ " + (Convert.ToDouble(oldcount - newcount) / Convert.ToDouble(newcount)).ToString("0.0%");
411
-                                }
412
-                                else if (oldcount < newcount)
413
-                                {
414
-                                    bl = " ↑ " + (Convert.ToDouble(newcount - oldcount) / Convert.ToDouble(newcount)).ToString("0.0%");
415
-                                }
416
-                            }
417
-                            else
418
-                            {
419
-                                bl = " --";
420
-                            }
421
-                        }
422
-
423
-                        var obj = new
424
-                        {
425
-                            bl = bl,
426
-                            col = cols.Select(p => p + "日"),
427
-                            worktotal = worktotal,
428
-                            teltotal = teltotal
429
-                        };
401
+                        //    if (oldcount == newcount)
402
+                        //    {
403
+                        //        bl = " 持平";
404
+                        //    }
405
+                        //    else
406
+                        //    {
407
+                        //        if (newcount != 0)
408
+                        //        {
409
+                        //            if (oldcount > newcount)
410
+                        //            {
411
+                        //                bl = " ↓ " + (Convert.ToDouble(oldcount - newcount) / Convert.ToDouble(newcount)).ToString("0.0%");
412
+                        //            }
413
+                        //            else if (oldcount < newcount)
414
+                        //            {
415
+                        //                bl = " ↑ " + (Convert.ToDouble(newcount - oldcount) / Convert.ToDouble(newcount)).ToString("0.0%");
416
+                        //            }
417
+                        //        }
418
+                        //        else
419
+                        //        {
420
+                        //            bl = " --";
421
+                        //        }
422
+                        //    }
430 423
 
431
-                        res = Success("成功", obj);
424
+                        //    var obj = new
425
+                        //    {
426
+                        //        bl = bl,
427
+                        //        col = cols.Select(p => p + "日"),
428
+                        //        worktotal = worktotal,
429
+                        //        teltotal = teltotal
430
+                        //    };
431
+
432
+                        //    res = Success("成功", obj);
433
+                        res = Success("成功");
432 434
                     }
435
+
433 436
                 }
434 437
 
435 438
             }
@@ -558,6 +561,7 @@ namespace CallCenterApi.Interface.Controllers
558 561
                         //    //dcl = new BLL.T_Wo_WorkOrderItem().GetModelList(" IsDel=0 and Type=1 and (state='1' and SureUser='" + ua.F_UserCode + "')  ").Select(p => p.WorkOrderID).Distinct().Count()
559 562
                         //};
560 563
                         //res = Success("成功", obj);
564
+                        res = Success("");
561 565
                     }
562 566
                 }
563 567
             }

+ 3 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs

@@ -15,7 +15,7 @@ namespace CallCenterApi.Interface.Controllers.report
15 15
     {
16 16
         public ActionResult GetDataList(string stime, string endtime, int deptid = 0)
17 17
         {
18
-            DataTable dtNew = getData(stime, endtime, deptid);
18
+            DataTable dtNew = new DataTable();//getData(stime, endtime, deptid);
19 19
             var obj = new
20 20
             {
21 21
                 dtNew,
@@ -27,7 +27,8 @@ namespace CallCenterApi.Interface.Controllers.report
27 27
         public ActionResult ExptList(string stime, string endtime, int deptid = 0)
28 28
         {
29 29
             NPOIHelper npoi = new NPOIHelper();
30
-            DataTable dt = getData(stime, endtime, deptid);
30
+            DataTable dt = new DataTable();
31
+            //DataTable dt = getData(stime, endtime, deptid);
31 32
             if (npoi.ExportToExcel("业务报表数据", dt) == "")
32 33
             {
33 34
                 return Success("导出成功");