zhangkun лет назад: 5
Родитель
Сommit
da3cbab8ae

+ 5 - 0
web/BaseCallCenter.BLL/COM/T_Com_Class.cs

@@ -143,6 +143,11 @@ namespace YTSoft.BaseCallCenter.BLL
143 143
         {
144 144
             return dal.GetTreeJsonModel(parentId, type);
145 145
         }
146
+
147
+        public TreeNodeModel GetTreeJsonModelTurn(string usercode)
148
+        {
149
+            return dal.GetTreeJsonModelTurn(usercode);
150
+        }
146 151
         #endregion  ExtensionMethod
147 152
     }
148 153
 }

+ 8 - 0
web/BaseCallCenter.BLL/T_Sys_Department.cs

@@ -148,6 +148,14 @@ namespace YTSoft.BaseCallCenter.BLL
148 148
             return dal.GetDepartmentJsonModel(parentId, AddUser);
149 149
         }
150 150
 
151
+        /// <summary>
152
+        /// 转单部门节点
153
+        /// </summary>
154
+        public TreeNodeModel GetDepartmentJsonModelTrun(int parentId, string key = "")
155
+        {
156
+            return dal.GetDepartmentJsonModelTurn(parentId, key);
157
+        }
158
+
151 159
 
152 160
         /// <summary>
153 161
         /// 得到一个对象实体

+ 3 - 0
web/BaseCallCenter.BLL/YTSoft.BaseCallCenter.BLL.csproj

@@ -166,6 +166,9 @@
166 166
   <ItemGroup>
167 167
     <None Include="app.config" />
168 168
   </ItemGroup>
169
+  <ItemGroup>
170
+    <Folder Include="User\" />
171
+  </ItemGroup>
169 172
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
170 173
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
171 174
        Other similar extension points exist, see Microsoft.Common.targets.

+ 113 - 0
web/BaseCallCenter.DAL/COM/T_Com_Class.cs

@@ -204,6 +204,27 @@ namespace YTSoft.BaseCallCenter.DAL
204 204
             }
205 205
         }
206 206
 
207
+        public YTSoft.BaseCallCenter.Model.T_Com_Class GetModelByWhere(string where)
208
+        {
209
+
210
+            StringBuilder strSql = new StringBuilder();
211
+            strSql.Append("select  top 1 Classid,Classcode,Classname,Parentid,Parentcode,ParentName,Sort,iconClose,iconOpen,Describe,Remark,typeid from T_Com_Class ");
212
+            if (!string.IsNullOrEmpty(where))
213
+            {
214
+                strSql.Append(" where " + where);
215
+            }
216
+
217
+            DataSet ds = DbHelperSQL.Query(strSql.ToString());
218
+            if (ds.Tables[0].Rows.Count > 0)
219
+            {
220
+                return DataRowToModel(ds.Tables[0].Rows[0]);
221
+            }
222
+            else
223
+            {
224
+                return null;
225
+            }
226
+        }
227
+
207 228
 
208 229
         /// <summary>
209 230
         /// 得到一个对象实体
@@ -458,6 +479,98 @@ namespace YTSoft.BaseCallCenter.DAL
458 479
 
459 480
         }
460 481
 
482
+
483
+
484
+
485
+
486
+        /// <summary>
487
+        ///  获得当前节点下的所有子集以tree的格式
488
+        /// </summary>
489
+        public TreeNodeModel GetTreeJsonModelTurn(string usercode)
490
+        {
491
+            // Classid,Classcode,Classname,Parentid,Parentcode,ParentName,Sort,iconClose,iconOpen,Describe,Remark,typeid
492
+            TreeNodeModel returnModel = new TreeNodeModel();
493
+            DataSet ds = null;
494
+            TreeNodeModel model = new TreeNodeModel();
495
+            Model.T_Com_Class modelclass = GetModelByWhere(string.Format("parentid=(select Classid from T_Com_Class where  Classname='常用人员' and parentid=0) and Remark='{0}'",usercode));
496
+            if (modelclass != null)
497
+            {
498
+                ds = GetList(string.Format("typeid={0} Or parentid={0} Order by sort desc", modelclass.Classid));
499
+
500
+                List<TreeNodeModel> modelList = new List<TreeNodeModel>();
501
+                model.id = modelclass.Classid;
502
+                model.name = "常用名单";
503
+                model.code = modelclass.Classid;
504
+                model.iconClose = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_close.png";
505
+                model.iconOpen = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_open.png";
506
+                model.open = "true";
507
+                model.IsOrPrivate = 0;
508
+                model.children = modelList;
509
+
510
+            }
511
+            else
512
+            {
513
+                List<TreeNodeModel> modelList = new List<TreeNodeModel>();
514
+                model.id = 0;
515
+                model.name = "常用名单";
516
+                model.code = 0;
517
+                model.iconClose = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_close.png";
518
+                model.iconOpen = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_open.png";
519
+                model.open = "true";
520
+                model.IsOrPrivate = 0;
521
+                model.children = null;
522
+              
523
+            }
524
+
525
+
526
+
527
+
528
+            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
529
+            {
530
+                returnModel = GetTreeModelTurn(ds.Tables[0], model);
531
+            }
532
+            else
533
+            {
534
+                returnModel = model;
535
+            }
536
+
537
+            return returnModel;
538
+        }
539
+
540
+
541
+        /// <summary>
542
+        /// 获取chlid
543
+        /// </summary>
544
+        /// <param name="table">数据结合</param>
545
+        /// <param name="model">当前model</param>
546
+        /// <returns></returns>
547
+        public TreeNodeModel GetTreeModelTurn(DataTable table, TreeNodeModel model)
548
+        {
549
+            DataRow[] rows = table.Select("Parentid=" + model.id);
550
+            if (rows != null && rows.Length > 0)
551
+            {
552
+                foreach (DataRow row in rows)
553
+                {
554
+
555
+                    List<TreeNodeModel> modelList = new List<TreeNodeModel>();
556
+                    TreeNodeModel childModel = new TreeNodeModel();
557
+                    childModel.id = int.Parse(row["Classid"].ToString());
558
+                    childModel.name = row["Classname"].ToString();
559
+                    childModel.code = row["Remark"].ToInt32();
560
+                    childModel.iconClose = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_close.png";
561
+                    childModel.iconOpen = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_open.png";
562
+                    childModel.open = "false";
563
+                    childModel.IsOrPrivate = 1;
564
+                    childModel.children = modelList;
565
+                    model.children.Add(childModel);
566
+                    GetTreeModelTurn(table, childModel);
567
+                }
568
+            }
569
+
570
+            return model;
571
+
572
+        }
573
+
461 574
         #endregion
462 575
     }
463 576
 }

+ 11 - 2
web/BaseCallCenter.DAL/Order/T_Wo_WorkOrderBase.cs

@@ -1474,7 +1474,7 @@ F_SERVICETYPE,F_DECLARATIONTIME,F_SERVICENATURE,F_SERVICEWAY,F_RETURNVISITMAN,F_
1474 1474
                 {
1475 1475
                     //转单
1476 1476
                     model.F_WORKORDERSTATEID = 1;
1477
-                    if (model.F_REQUESTSERVICETIME == null)
1477
+                    if (model.F_REQUESTSERVICETIME.HasValue&& model.F_REQUESTSERVICETIME.Value.Year==1)
1478 1478
                     {
1479 1479
                         model.F_REQUESTSERVICETIME = null;
1480 1480
                     }
@@ -1484,7 +1484,16 @@ F_SERVICETYPE,F_DECLARATIONTIME,F_SERVICENATURE,F_SERVICEWAY,F_RETURNVISITMAN,F_
1484 1484
                         historyModel.F_OPTDATE = DateTime.Now;
1485 1485
                         historyModel.F_WORKORDERSTATEID = 0;
1486 1486
                         historyModel.F_StateName = "未处理";
1487
-                        historyModel.NeedReplayTime = model.F_REQUESTSERVICETIME;
1487
+                        if (model.F_REQUESTSERVICETIME.HasValue)
1488
+                        {
1489
+                            historyModel.NeedReplayTime = model.F_REQUESTSERVICETIME.Value.AddDays(1).AddSeconds(-1);
1490
+                        }
1491
+                        else
1492
+                        {
1493
+                            historyModel.NeedReplayTime = model.F_REQUESTSERVICETIME;
1494
+                        }
1495
+                       
1496
+
1488 1497
                         historyId = InsertWorkOrderHistoryModel(historyModel);
1489 1498
                     }
1490 1499
                     historyId = model.HistoryOrderList.Count;

+ 1 - 1
web/BaseCallCenter.DAL/Order/T_Wo_WorkOrderNotice.cs

@@ -220,7 +220,7 @@ namespace YTSoft.BaseCallCenter.DAL
220 220
 
221 221
             StringBuilder strSql = new StringBuilder();
222 222
             strSql.Append(" update T_Wo_WorkOrderNotice ");
223
-            strSql.Append(" set NoticeState=0,DZNumber=DZNumber+1 ");
223
+            strSql.Append(" set NoticeState=0  ");
224 224
             strSql.Append(" where OrderId=@OrderId;");
225 225
             SqlParameter[] parameters = {
226 226
                     new SqlParameter("@OrderId",orderid)

+ 2 - 1
web/BaseCallCenter.DAL/Report/ReportDAL.cs

@@ -64,7 +64,7 @@ namespace YTSoft.BaseCallCenter.DAL
64 64
         {
65 65
             StringBuilder strSql = new StringBuilder();
66 66
             strSql.Append("SELECT  CallState,COUNT(CallState) as num  FROM T_Call_CallRecords  ");
67
-            strSql.Append(" where CallType=0  AND ( RingLongTime>3 OR CallState=1) ");
67
+            strSql.Append(" where CallType=0  AND ( RingLongTime>15 OR CallState=1) ");
68 68
             strSql.Append(" and CONVERT(varchar(100), BeginTime, 8)>='08:30:00' ");
69 69
             strSql.Append(" and CONVERT(varchar(100), BeginTime, 8)<='20:00:00' ");
70 70
             if (!string.IsNullOrEmpty(startDate))
@@ -103,6 +103,7 @@ namespace YTSoft.BaseCallCenter.DAL
103 103
             StringBuilder strSql = new StringBuilder();
104 104
             strSql.Append("SELECT COUNT(1) num,t.CallState FROM   ");
105 105
             strSql.Append(" (SELECT CASE   ");
106
+
106 107
             //未转派 超时0
107 108
             strSql.Append("  WHEN F_SENTORDERTIME IS NULL AND DATEDIFF(minute, DATEADD(day,1,F_CREATEDATE),  GETDATE())> 0  THEN 0   ");
108 109
             //未转派 未超时1

+ 69 - 12
web/BaseCallCenter.DAL/T_Sys_Department.cs

@@ -438,7 +438,7 @@ namespace YTSoft.BaseCallCenter.DAL
438 438
                 {
439 439
                     List<TreeNodeModel> modelList = new List<TreeNodeModel>();
440 440
                     model.id = 0;
441
-                    model.name = "部门列表";
441
+                    model.name = "郑州地铁";
442 442
                     model.code = 0;
443 443
                     model.iconClose = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_close.png";
444 444
                     model.iconOpen = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_open.png";
@@ -513,18 +513,39 @@ namespace YTSoft.BaseCallCenter.DAL
513 513
         }
514 514
 
515 515
 
516
-
517 516
         /// <summary>
518 517
         ///  获得当前节点下的所有子集以tree的格式
519 518
         /// </summary>
520
-        public TreeNodeModel GetDepartmentJsonModeldic(int parentId, bool AddUser = false)
519
+        public TreeNodeModel GetDepartmentJsonModelTurn(int parentId, string key = "")
521 520
         {
522 521
             TreeNodeModel returnModel = new TreeNodeModel();
523 522
             StringBuilder strSql = new StringBuilder();
524
-            strSql.Append("select * ");
525
-            strSql.Append(" FROM T_Sys_Department  order by F_Sort asc");
523
+            strSql.Append("SELECT * FROM T_Sys_Department ");
524
+            if (!string.IsNullOrEmpty(key))
525
+            {
526
+                strSql.AppendFormat("WHERE (F_DeptName  LIKE '%{0}%' OR F_DeptId IN(SELECT F_DeptId FROM dbo.T_Sys_UserAccount WHERE F_UserName LIKE '%{0}%'))", key);
527
+            }
528
+            strSql.Append(" order by F_Sort asc");
526 529
 
527 530
             DataSet ds = DbHelperSQL.Query(strSql.ToString());
531
+            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0&& !string.IsNullOrEmpty(key))
532
+            {
533
+
534
+                string strlist = "0";
535
+                foreach (DataRow row in ds.Tables[0].Rows)
536
+                {
537
+                    strlist += ",";
538
+                    strlist += row["F_DeptId"];
539
+                    strlist += ",";
540
+                    strlist += row["F_ParentId"];
541
+                }
542
+                strSql.Clear();
543
+                strSql.Append("SELECT * FROM T_Sys_Department ");
544
+                strSql.AppendFormat("WHERE  F_DeptId IN({0})", strlist);
545
+
546
+                strSql.Append(" order by F_Sort asc");
547
+                ds = DbHelperSQL.Query(strSql.ToString());
548
+            }
528 549
 
529 550
             if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
530 551
             {
@@ -533,14 +554,14 @@ namespace YTSoft.BaseCallCenter.DAL
533 554
                 {
534 555
                     List<TreeNodeModel> modelList = new List<TreeNodeModel>();
535 556
                     model.id = 0;
536
-                    model.name = "常用人员";
557
+                    model.name = "郑州地铁";
537 558
                     model.code = 0;
538 559
                     model.iconClose = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_close.png";
539 560
                     model.iconOpen = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_open.png";
540 561
                     model.open = "true";
541 562
                     model.children = modelList;
542 563
                 }
543
-                returnModel = GetTreeModel(ds.Tables[0], model, AddUser);
564
+                returnModel = GetTreeModelTurnDept(ds.Tables[0], model, key);
544 565
 
545 566
             }
546 567
             return returnModel;
@@ -553,7 +574,7 @@ namespace YTSoft.BaseCallCenter.DAL
553 574
         /// <param name="table">数据结合</param>
554 575
         /// <param name="model">当前model</param>
555 576
         /// <returns></returns>
556
-        public TreeNodeModel GetTreeModeldic(DataTable table, TreeNodeModel model, bool AddUser)
577
+        public TreeNodeModel GetTreeModelTurnDept(DataTable table, TreeNodeModel model, string key = "")
557 578
         {
558 579
             DataRow[] rows = table.Select("F_ParentId=" + model.code);
559 580
             if (rows != null && rows.Length > 0)
@@ -565,17 +586,25 @@ namespace YTSoft.BaseCallCenter.DAL
565 586
                     childModel.id = int.Parse(row["F_DeptId"].ToString());
566 587
                     childModel.name = row["F_DeptName"].ToString();
567 588
                     childModel.code = int.Parse(row["F_DeptId"].ToString());
568
-                    childModel.iconClose = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_close.png";
569
-                    childModel.iconOpen = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_open.png";
589
+                    if (model.code==0)
590
+                    {
591
+                        childModel.iconClose = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_close.png";
592
+                        childModel.iconOpen = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_open.png";                       
593
+                    }
594
+                    else
595
+                    {
596
+                        childModel.iconClose = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/2_close.png";
597
+                        childModel.iconOpen = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/2_close.png";
598
+                    }
570 599
                     //childModel.iconClose = row["F_Header"].ToMyString();
571 600
                     //childModel.iconOpen = childModel.iconClose + ".png";
572 601
                     childModel.open = "true";
573 602
                     childModel.children = modelList;
574 603
                     model.children.Add(childModel);
575
-                    GetTreeModel(table, childModel, AddUser);
604
+                    GetTreeModelTurnDept(table, childModel, key);
576 605
                 }
577 606
             }
578
-            else if (AddUser)
607
+            else if (model.name.Contains(key) || string.IsNullOrEmpty(key))
579 608
             {
580 609
                 StringBuilder strSql = new StringBuilder();
581 610
                 strSql.Append("select * ");
@@ -603,6 +632,34 @@ namespace YTSoft.BaseCallCenter.DAL
603 632
 
604 633
                 }
605 634
             }
635
+            else
636
+            {
637
+                StringBuilder strSql = new StringBuilder();
638
+                strSql.Append("select * ");
639
+                strSql.AppendFormat(" FROM T_Sys_UserAccount where F_DeptId={0} AND F_UserName LIKE '%{1}%'", model.code,key);
640
+
641
+                DataSet ds = DbHelperSQL.Query(strSql.ToString());
642
+
643
+                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
644
+                {
645
+
646
+                    foreach (DataRow row in ds.Tables[0].Rows)
647
+                    {
648
+                        List<TreeNodeModel> modelList = new List<TreeNodeModel>();
649
+                        TreeNodeModel childModel = new TreeNodeModel();
650
+                        childModel.id = int.Parse(row["F_UserId"].ToString());
651
+                        childModel.name = row["F_UserName"].ToString();
652
+                        childModel.code = int.Parse(row["F_UserId"].ToString());
653
+                        childModel.iconClose = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_close.png";
654
+                        childModel.iconOpen = "../../Content/layui/zTree/v3/css/zTreeStyle/img/diy/1_open.png";
655
+                        childModel.open = "false";
656
+                        childModel.IsOrPrivate = 1;
657
+                        childModel.children = modelList;
658
+                        model.children.Add(childModel);
659
+                    }
660
+
661
+                }
662
+            }
606 663
             return model;
607 664
 
608 665
         }

+ 6 - 1
web/BaseCallCenter.DAL/T_Wo_WorkOrderHistory.cs

@@ -73,6 +73,7 @@ namespace YTSoft.BaseCallCenter.DAL
73 73
             strSql.Append("F_OPTBTNID=@F_OPTBTNID,");
74 74
             strSql.Append("F_INSTANCEID=@F_INSTANCEID,");
75 75
             strSql.Append("F_TASKFLAG=@F_TASKFLAG,");
76
+            strSql.Append("ReplayTime=@ReplayTime,");
76 77
             strSql.Append("F_StateName=@F_StateName");
77 78
             strSql.Append(" where F_HISTORYID=@F_HISTORYID");
78 79
             SqlParameter[] parameters = {
@@ -86,7 +87,10 @@ namespace YTSoft.BaseCallCenter.DAL
86 87
 					new SqlParameter("@F_INSTANCEID", SqlDbType.Int,4),
87 88
 					new SqlParameter("@F_TASKFLAG", SqlDbType.Int,4),
88 89
 					new SqlParameter("@F_HISTORYID", SqlDbType.Int,4),
89
-                    new SqlParameter("@F_StateName", SqlDbType.VarChar,50)};
90
+                    new SqlParameter("@F_StateName", SqlDbType.VarChar,50),
91
+                    new SqlParameter("@ReplayTime", SqlDbType.DateTime)
92
+
93
+            };
90 94
             parameters[0].Value = model.F_WORKORDERSTATEID;
91 95
             parameters[1].Value = model.F_OPTUSERID;
92 96
             parameters[2].Value = model.F_OPTDATE;
@@ -98,6 +102,7 @@ namespace YTSoft.BaseCallCenter.DAL
98 102
             parameters[8].Value = model.F_TASKFLAG;
99 103
             parameters[9].Value = model.F_HISTORYID;
100 104
             parameters[10].Value = model.F_StateName;
105
+            parameters[11].Value = model.ReplayTime;
101 106
 
102 107
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
103 108
             if (rows > 0)

+ 3 - 0
web/BaseCallCenter.DAL/YTSoft.BaseCallCenter.DAL.csproj

@@ -169,6 +169,9 @@
169 169
   <ItemGroup>
170 170
     <None Include="app.config" />
171 171
   </ItemGroup>
172
+  <ItemGroup>
173
+    <Folder Include="User\" />
174
+  </ItemGroup>
172 175
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
173 176
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
174 177
        Other similar extension points exist, see Microsoft.Common.targets.

+ 3 - 0
web/BaseCallCenter.Model/YTSoft.BaseCallCenter.Model.csproj

@@ -165,6 +165,9 @@
165 165
   <ItemGroup>
166 166
     <None Include="app.config" />
167 167
   </ItemGroup>
168
+  <ItemGroup>
169
+    <Folder Include="User\" />
170
+  </ItemGroup>
168 171
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
169 172
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
170 173
        Other similar extension points exist, see Microsoft.Common.targets.