Selaa lähdekoodia

新增APP接口,超时工单数量

zhoufan 8 vuotta sitten
vanhempi
commit
92a49b8fb8

+ 24 - 4
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs

548
             Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
548
             Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
549
             string sql = " and F_IsDelete=0 and F_WorkState in (2,4,8)";
549
             string sql = " and F_IsDelete=0 and F_WorkState in (2,4,8)";
550
             //管理员GLY
550
             //管理员GLY
551
+            //if (userModel.F_RoleCode != "GLY")
552
+            //{
553
+            //    sql += " and F_WorkOrderId in (select F_WorkOrderId from T_Bus_AssignedInfo where F_State=1 and F_IsDelete=0 and "
554
+            //    + " ISNULL(F_FeedbackTime, '')='' and F_MainDeptId =" + userModel.F_DeptId + " and F_IsSure in (0,1)";
555
+            //    sql += ")";
556
+            //}
557
+            sql += " and ( F_WorkOrderId in (select F_WorkOrderId  from T_Bus_AssignedInfo where F_State=1 and F_IsDelete=0 and F_LimitTime<getdate() and isnull(F_FeedbackTime,'')='' and F_IsSure in (0,1) ";
558
+
559
+            if (userModel.F_RoleCode != "GLY")
560
+            {
561
+                sql += " and  F_MainDeptId = '" + userModel.F_DeptId + "' ";
562
+            }
563
+
564
+            sql += ") or F_WorkOrderId in (select F_WorkOrderId from T_Bus_AssignedItemInfo where F_State=1 and F_IsDelete=0 and F_LimitTime<getdate() and ISNULL(F_FeedbackTime, '')='' ";
565
+
551
             if (userModel.F_RoleCode != "GLY")
566
             if (userModel.F_RoleCode != "GLY")
552
             {
567
             {
553
-                sql += " and F_WorkOrderId in (select F_WorkOrderId from T_Bus_AssignedInfo where F_State=1 and F_IsDelete=0 and "
554
-                + " ISNULL(F_FeedbackTime, '')='' and F_MainDeptId =" + userModel.F_DeptId + " and F_IsSure in (0,1)";
555
-                sql += ")";
568
+                sql += " and  F_DeptId = '" + userModel.F_DeptId + "' ";
556
             }
569
             }
570
+            sql += "))";
571
+
557
             string cols = "F_Id,F_WorkOrderId,F_CusName,F_CusPhone,F_ComTitle,F_ComContent,F_SourceAddress,F_CreateTime,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName ";
572
             string cols = "F_Id,F_WorkOrderId,F_CusName,F_CusPhone,F_ComTitle,F_ComContent,F_SourceAddress,F_CreateTime,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName ";
558
             int recordCount = 0;
573
             int recordCount = 0;
559
             dt = BLL.PagerBLL.GetListPager(
574
             dt = BLL.PagerBLL.GetListPager(
566
                 pageindex,
581
                 pageindex,
567
                 true,
582
                 true,
568
                 out recordCount);
583
                 out recordCount);
584
+
585
+
569
             var obj = new
586
             var obj = new
570
             {
587
             {
571
                 rows = dt,
588
                 rows = dt,
572
-                total = recordCount
589
+                total = recordCount,
590
+                timeoutcount = DbHelperSQL.GetSingle(" select count(1) as con from T_Bus_WorkOrder where 1=1 " + sql)
573
             };
591
             };
592
+            
593
+
574
             return Content(obj.ToJson());
594
             return Content(obj.ToJson());
575
         }
595
         }
576
 
596
 

+ 492 - 32
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

1590
         }
1590
         }
1591
 
1591
 
1592
         /// <summary>
1592
         /// <summary>
1593
+        /// 获取单位主办协办未处理工单列表
1594
+        /// </summary>
1595
+        /// <returns></returns>
1596
+        [Authority]
1597
+        public ActionResult GetDWNoDealList(int isdc = 0)
1598
+        {
1599
+            DataTable dt = new DataTable();
1600
+
1601
+            int userId = Utils.StrToInt(User.UserData["F_UserID"], 0);
1602
+
1603
+            Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
1604
+
1605
+            string sql = " and F_IsDelete=0";
1606
+            string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));
1607
+            string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
1608
+            string strkey = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));
1609
+            string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
1610
+            string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
1611
+            string strworkid = HttpUtility.UrlDecode(RequestString.GetQueryString("workid"));
1612
+            string strusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
1613
+
1614
+            string strstate = HttpUtility.UrlDecode(RequestString.GetQueryString("state"));
1615
+
1616
+            int source = RequestString.GetInt("source", 0);
1617
+            int keyid = RequestString.GetInt("keyid", 0);
1618
+            int type = RequestString.GetInt("type", 0);
1619
+            int bigtype = RequestString.GetInt("bigtype", 0);
1620
+            int smalltype = RequestString.GetInt("smalltype", 0);
1621
+            int sourcearea = RequestString.GetInt("sourcearea", 0);
1622
+            int deptid = RequestString.GetInt("deptid", 0);
1623
+
1624
+            string strpageindex = RequestString.GetQueryString("page");
1625
+            int pageindex = 1;
1626
+            string strpagesize = RequestString.GetQueryString("pagesize");
1627
+            int pagesize = 10;
1628
+
1629
+            if (userModel.F_RoleCode == "ZXHWY")
1630
+            {
1631
+                sql += " and F_CreateUser = '" + userModel.F_UserCode + "' ";
1632
+            }
1633
+            else if (strusercode.Trim() != "" && strusercode != "undefined")
1634
+            {
1635
+                sql += " and F_CreateUser = '" + strusercode + "' ";
1636
+            }
1637
+
1638
+
1639
+            sql += " and ( F_WorkOrderId in (select F_WorkOrderId  from T_Bus_AssignedInfo where F_State=1 and F_IsDelete=0 and isnull(F_FeedbackTime,'')='' and F_IsSure in (0,1) ";
1640
+
1641
+            if (userModel.F_RoleCode == "WLDW")
1642
+            {
1643
+                sql += " and  F_MainDeptId = '" + userModel.F_DeptId + "' ";
1644
+            }
1645
+            else if (deptid != 0)
1646
+            {
1647
+                sql += " and  F_MainDeptId = '" + deptid + "' ";
1648
+            }
1649
+
1650
+            sql += ") or F_WorkOrderId in (select F_WorkOrderId from T_Bus_AssignedItemInfo where F_State=1 and F_IsDelete=0 and ISNULL(F_FeedbackTime, '')='' ";
1651
+
1652
+            if (userModel.F_RoleCode == "WLDW")
1653
+            {
1654
+                sql += " and  F_DeptId = '" + userModel.F_DeptId + "' ";
1655
+            }
1656
+            else if (deptid != 0)
1657
+            {
1658
+                sql += " and  F_DeptId = '" + deptid + "' ";
1659
+            }
1660
+
1661
+            sql += "))";
1662
+
1663
+            if (strstate.Trim() != "" && strstate != "undefined")
1664
+            {
1665
+                sql += " and F_WorkState = '" + strstate.Trim() + "' ";
1666
+            }
1667
+            else
1668
+            {
1669
+                sql += " and F_WorkState in (2,4,8)";
1670
+            }
1671
+            if (strworkid.Trim() != "" && strworkid != "undefined")
1672
+            {
1673
+                sql += " and F_WorkOrderId like '%" + strworkid + "%' ";
1674
+            }
1675
+            if (strname.Trim() != "" && strname != "undefined")
1676
+            {
1677
+                sql += " and F_CusName like '%" + strname + "%' ";
1678
+            }
1679
+            if (strtel.Trim() != "" && strtel != "undefined")
1680
+            {
1681
+                sql += " and (F_CusPhone like '%" + strtel + "%' or F_ConPhone like '%" + strtel + "%') ";
1682
+            }
1683
+            if (strkey.Trim() != "" && strkey != "undefined")
1684
+            {
1685
+                sql += " and (F_ComTitle like '%" + strkey + "%' or F_ComContent like '%" + strkey + "%') ";
1686
+            }
1687
+
1688
+            if (source != 0)
1689
+            {
1690
+                sql += " and F_InfoSource = '" + source + "' ";
1691
+            }
1692
+            if (keyid != 0)
1693
+            {
1694
+                sql += " and ','+F_Key+',' like '%," + keyid + ",%' ";
1695
+            }
1696
+            if (type != 0)
1697
+            {
1698
+                sql += " and F_InfoType = '" + type + "' ";
1699
+            }
1700
+            if (bigtype != 0)
1701
+            {
1702
+                sql += " and F_InfoConBigType = '" + bigtype + "' ";
1703
+            }
1704
+            if (smalltype != 0)
1705
+            {
1706
+                sql += " and F_InfoConSmallType = '" + smalltype + "' ";
1707
+            }
1708
+            if (sourcearea != 0)
1709
+            {
1710
+                sql += " and F_SourceArea = '" + sourcearea + "' ";
1711
+            }
1712
+
1713
+            if (strstarttime.Trim() != "" && strstarttime != "undefined")
1714
+            {
1715
+                sql += " and datediff(day,F_CreateTime,'" + strstarttime + "')<=0 ";
1716
+            }
1717
+            if (strendtime.Trim() != "" && strendtime != "undefined")
1718
+            {
1719
+                sql += " and datediff(day,F_CreateTime,'" + strendtime + "')>=0   ";
1720
+            }
1721
+
1722
+            if (strpageindex.Trim() != "")
1723
+            {
1724
+                pageindex = Convert.ToInt32(strpageindex);
1725
+            }
1726
+
1727
+            if (strpagesize.Trim() != "")
1728
+            {
1729
+                pagesize = Convert.ToInt32(strpagesize);
1730
+            }
1731
+
1732
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName ";
1733
+
1734
+            if (isdc > 0)
1735
+            {
1736
+                var dtdc = DbHelperSQL.Query(" select " + cols + " from T_Bus_WorkOrder where 1=1 " + sql).Tables[0];
1737
+                var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc);
1738
+                if (msg == "")
1739
+                {
1740
+                    return Success("导出成功");
1741
+                }
1742
+                else
1743
+                {
1744
+                    return Error("导出失败");
1745
+                }
1746
+            }
1747
+
1748
+            int recordCount = 0;
1749
+            dt = BLL.PagerBLL.GetListPager(
1750
+                "T_Bus_WorkOrder",
1751
+                "F_WorkOrderId",
1752
+                cols,
1753
+                sql,
1754
+                "ORDER BY F_CreateTime DESC",
1755
+                pagesize,
1756
+                pageindex,
1757
+                true,
1758
+                out recordCount);
1759
+
1760
+            #region 声音文件
1761
+            dt.Columns.Add("DeptName", typeof(string));//交办单位
1762
+            dt.Columns.Add("OtherDeptName", typeof(string));//协办单位
1763
+            dt.Columns.Add("OverState", typeof(string));//超时状态
1764
+            dt.Columns.Add("LimitTime", typeof(string));//限制时间
1765
+            dt.Columns.Add("GapTime", typeof(string));//时间差
1766
+            dt.Columns.Add("FilePath", typeof(string));
1767
+            dt.Columns.Add("Buttons", typeof(object));
1768
+            var configly = configBll.GetModelList(" F_ParamCode='PlayLeaveVoice' ").FirstOrDefault();
1769
+            var config = configBll.GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
1770
+            var configcs = configBll.GetModelList(" F_ParamCode='CSYJ' ").FirstOrDefault();
1771
+            foreach (DataRow dr in dt.Rows)
1772
+            {
1773
+                //获取最新交办信息
1774
+                string iszbdw = "0";
1775
+                string sqljb = "SELECT TOP 1 * FROM T_Bus_AssignedInfo WHERE F_WorkOrderId='" + dr["F_WorkOrderId"].ToString() + "' and F_State=1 and F_IsDelete=0 and F_IsSure<>3 ORDER BY F_Id DESC";
1776
+                var dtjb = DbHelperSQL.Query(sqljb).Tables[0];
1777
+                if (dtjb.Rows.Count > 0)
1778
+                {
1779
+                    if (dtjb.Rows[0]["F_MainDeptId"].ToString() == userModel.F_DeptId.ToString()) { iszbdw = "1"; }
1780
+                    dr["DeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_MainDeptId"].ToString() + "')");
1781
+                    if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
1782
+                    {
1783
+                        dr["OtherDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_OtherDeptIds"].ToString() + "')");
1784
+                    }
1785
+
1786
+                    var lt = dtjb.Rows[0]["F_LimitTime"].ToString();//限制时间
1787
+                    dr["LimitTime"] = lt;
1788
+                    var state = dr["F_WorkState"].ToString();
1789
+                    if (state != "6" && state != "7" && state != "9")
1790
+                    {
1791
+                        var ltime = DateTime.Parse(lt);
1792
+                        TimeSpan ts = ltime.Subtract(DateTime.Now);
1793
+                        int tss = Int32.Parse(Math.Round(ts.TotalSeconds, 0).ToString());
1794
+                        if (tss < 0) { tss = -tss; }
1795
+                        string gshsj = DateTimeConvert.parseTimeSeconds(tss, 1);
1796
+                        if (ltime > DateTime.Now)
1797
+                        {
1798
+                            if (configcs != null)
1799
+                            {
1800
+                                int cs = Int32.Parse(configcs.F_ParamValue);
1801
+                                if (ts.TotalHours > cs)
1802
+                                {
1803
+                                    dr["OverState"] = 1;
1804
+                                }
1805
+                                else
1806
+                                {
1807
+                                    dr["OverState"] = 2;
1808
+                                }
1809
+                            }
1810
+                            dr["GapTime"] = "剩余" + gshsj;
1811
+                        }
1812
+                        else
1813
+                        {
1814
+                            dr["OverState"] = 3;
1815
+                            dr["GapTime"] = "超时" + gshsj;
1816
+                        }
1817
+                    }
1818
+                }
1819
+                if (dr["F_LeaveRecordId"] != null && dr["F_LeaveRecordId"].ToString() != "")
1820
+                {
1821
+                    dr["FilePath"] = GetLeavePath(dr["F_LeaveRecordId"].ToString(), config.F_ParamValue);
1822
+                }
1823
+                else if (dr["F_CallRecordId"] != null && dr["F_CallRecordId"].ToString() != "")
1824
+                {
1825
+                    dr["FilePath"] = GetCallPath(dr["F_CallRecordId"].ToString(), config.F_ParamValue);
1826
+                }
1827
+
1828
+                List<ButtonGroup.button> btns = new List<ButtonGroup.button>();
1829
+                btns.Add(ButtonGroup.query());
1830
+                dr["Buttons"] = btns;
1831
+            }
1832
+            #endregion
1833
+
1834
+            var obj = new
1835
+            {
1836
+                state = "success",
1837
+                message = "成功",
1838
+                rows = dt,
1839
+                total = recordCount
1840
+            };
1841
+
1842
+            return Content(obj.ToJson());
1843
+        }
1844
+
1845
+        /// <summary>
1593
         /// 获取逾期未回复工单列表
1846
         /// 获取逾期未回复工单列表
1594
         /// </summary>
1847
         /// </summary>
1595
         /// <returns></returns>
1848
         /// <returns></returns>
2050
             return Content(obj.ToJson());
2303
             return Content(obj.ToJson());
2051
         }
2304
         }
2052
 
2305
 
2306
+        ///// <summary>
2307
+        ///// 获取通报工单列表
2308
+        ///// </summary>
2309
+        ///// <returns></returns>
2310
+        //[Authority]
2311
+        //public ActionResult GetNoticeList(int isdc = 0)
2312
+        //{
2313
+        //    DataTable dt = new DataTable();
2314
+
2315
+        //    int userId = Utils.StrToInt(User.UserData["F_UserID"], 0);
2316
+
2317
+        //    Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
2318
+
2319
+        //    string sql = " and F_IsDelete=0 and isnull(F_IsNotice,0) =1";
2320
+        //    string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));
2321
+        //    string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
2322
+        //    string strkey = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));
2323
+        //    string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
2324
+        //    string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
2325
+        //    string strworkid = HttpUtility.UrlDecode(RequestString.GetQueryString("workid"));
2326
+        //    string strusercode = HttpUtility.UrlDecode(RequestString.GetQueryString("usercode"));
2327
+
2328
+        //    int source = RequestString.GetInt("source", 0);
2329
+        //    int keyid = RequestString.GetInt("keyid", 0);
2330
+        //    int type = RequestString.GetInt("type", 0);
2331
+        //    int bigtype = RequestString.GetInt("bigtype", 0);
2332
+        //    int smalltype = RequestString.GetInt("smalltype", 0);
2333
+        //    int sourcearea = RequestString.GetInt("sourcearea", 0);
2334
+        //    int deptid = RequestString.GetInt("deptid", 0);
2335
+
2336
+        //    string strpageindex = RequestString.GetQueryString("page");
2337
+        //    int pageindex = 1;
2338
+        //    string strpagesize = RequestString.GetQueryString("pagesize");
2339
+        //    int pagesize = 10;
2340
+
2341
+        //    if (strworkid.Trim() != "" && strworkid != "undefined")
2342
+        //    {
2343
+        //        sql += " and F_WorkOrderId like '%" + strworkid + "%' ";
2344
+        //    }
2345
+        //    if (strname.Trim() != "" && strname != "undefined")
2346
+        //    {
2347
+        //        sql += " and F_CusName like '%" + strname + "%' ";
2348
+        //    }
2349
+        //    if (strtel.Trim() != "" && strtel != "undefined")
2350
+        //    {
2351
+        //        sql += " and (F_CusPhone like '%" + strtel + "%' or F_ConPhone like '%" + strtel + "%') ";
2352
+        //    }
2353
+        //    if (strkey.Trim() != "" && strkey != "undefined")
2354
+        //    {
2355
+        //        sql += " and (F_ComTitle like '%" + strkey + "%' or F_ComContent like '%" + strkey + "%') ";
2356
+        //    }
2357
+        //    if (strusercode.Trim() != "" && strusercode != "undefined")
2358
+        //    {
2359
+        //        sql += " and F_CreateUser = '" + strusercode + "' ";
2360
+        //    }
2361
+
2362
+        //    if (source != 0)
2363
+        //    {
2364
+        //        sql += " and F_InfoSource = '" + source + "' ";
2365
+        //    }
2366
+        //    if (keyid != 0)
2367
+        //    {
2368
+        //        sql += " and ','+F_Key+',' like '%," + keyid + ",%' ";
2369
+        //    }
2370
+        //    if (type != 0)
2371
+        //    {
2372
+        //        sql += " and F_InfoType = '" + type + "' ";
2373
+        //    }
2374
+        //    if (bigtype != 0)
2375
+        //    {
2376
+        //        sql += " and F_InfoConBigType = '" + bigtype + "' ";
2377
+        //    }
2378
+        //    if (smalltype != 0)
2379
+        //    {
2380
+        //        sql += " and F_InfoConSmallType = '" + smalltype + "' ";
2381
+        //    }
2382
+        //    if (sourcearea != 0)
2383
+        //    {
2384
+        //        sql += " and F_SourceArea = '" + sourcearea + "' ";
2385
+        //    }
2386
+        //    if (deptid != 0)
2387
+        //    {
2388
+        //        string sqlwhere = "select F_WorkOrderID from T_Bus_AssignedInfo where F_MainDeptId = '" + deptid + "' and F_IsSure in (0,1) and F_State=1 and F_IsDelete=0 ";
2389
+        //        sql += " and F_WorkOrderID in(" + sqlwhere + ")";
2390
+        //    }
2391
+        //    if (strstarttime.Trim() != "" && strstarttime != "undefined")
2392
+        //    {
2393
+        //        sql += " and datediff(day,F_CreateTime,'" + strstarttime + "')<=0 ";
2394
+        //    }
2395
+        //    if (strendtime.Trim() != "" && strendtime != "undefined")
2396
+        //    {
2397
+        //        sql += " and datediff(day,F_CreateTime,'" + strendtime + "')>=0   ";
2398
+        //    }
2399
+
2400
+        //    if (strpageindex.Trim() != "")
2401
+        //    {
2402
+        //        pageindex = Convert.ToInt32(strpageindex);
2403
+        //    }
2404
+
2405
+        //    if (strpagesize.Trim() != "")
2406
+        //    {
2407
+        //        pagesize = Convert.ToInt32(strpagesize);
2408
+        //    }
2409
+
2410
+        //    string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName";
2411
+
2412
+        //    if (isdc > 0)
2413
+        //    {
2414
+        //        var dtdc = DbHelperSQL.Query(" select " + cols + " from T_Bus_WorkOrder where 1=1 " + sql).Tables[0];
2415
+        //        var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc);
2416
+        //        if (msg == "")
2417
+        //        {
2418
+        //            return Success("导出成功");
2419
+        //        }
2420
+        //        else
2421
+        //        {
2422
+        //            return Error("导出失败");
2423
+        //        }
2424
+        //    }
2425
+
2426
+        //    int recordCount = 0;
2427
+        //    dt = BLL.PagerBLL.GetListPager(
2428
+        //        "T_Bus_WorkOrder",
2429
+        //        "F_WorkOrderId",
2430
+        //        cols,
2431
+        //        sql,
2432
+        //        "ORDER BY F_CreateTime DESC",
2433
+        //        pagesize,
2434
+        //        pageindex,
2435
+        //        true,
2436
+        //        out recordCount);
2437
+
2438
+        //    #region 声音文件
2439
+        //    dt.Columns.Add("DeptName", typeof(string));//交办单位
2440
+        //    dt.Columns.Add("OtherDeptName", typeof(string));//协办单位
2441
+        //    dt.Columns.Add("NoticeDeptName", typeof(string));//通报单位
2442
+        //    dt.Columns.Add("NoticeReson", typeof(string));//通报原因
2443
+        //    dt.Columns.Add("IsReturnNotice", typeof(string));
2444
+        //    dt.Columns.Add("FilePath", typeof(string));
2445
+        //    dt.Columns.Add("Buttons", typeof(object));
2446
+        //    var configly = configBll.GetModelList(" F_ParamCode='PlayLeaveVoice' ").FirstOrDefault();
2447
+        //    var config = configBll.GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
2448
+        //    int IsReturnNotice = 0;
2449
+        //    if (userModel.F_RoleCode == "ZXLD" || userModel.F_RoleCode == "ZXLDGLY" || userModel.F_RoleCode == "GLY")
2450
+        //    {
2451
+        //        IsReturnNotice = 1;
2452
+        //    }
2453
+        //    foreach (DataRow dr in dt.Rows)
2454
+        //    {
2455
+        //        //获取最新交办信息
2456
+        //        //string iszbdw = "0";
2457
+        //        string sqljb = "SELECT TOP 1 * FROM T_Bus_AssignedInfo WHERE F_WorkOrderId='" + dr["F_WorkOrderId"].ToString() + "' and F_State=1 and F_IsDelete=0 and F_IsSure<>3 ORDER BY F_Id DESC";
2458
+        //        var dtjb = DbHelperSQL.Query(sqljb).Tables[0];
2459
+        //        if (dtjb.Rows.Count > 0)
2460
+        //        {
2461
+        //            //if (dtjb.Rows[0]["F_MainDeptId"].ToString() == userModel.F_DeptId.ToString()) { iszbdw = "1"; }
2462
+        //            dr["DeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_MainDeptId"].ToString() + "')");
2463
+        //            if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
2464
+        //            {
2465
+        //                dr["OtherDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_OtherDeptIds"].ToString() + "')");
2466
+        //            }
2467
+        //            //int did = Int32.Parse(dtjb.Rows[0]["F_MainDeptId"].ToString());
2468
+        //            //var deptinfo = new BLL.T_Sys_Department().GetModel(did);
2469
+        //            //if (deptinfo != null)
2470
+        //            //{
2471
+        //            //    //if (did == userModel.F_DeptId) { iszbdw = "1"; }
2472
+        //            //    dr["DeptName"] = deptinfo.F_DeptName;//交办单位
2473
+        //            //}
2474
+
2475
+        //            //if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
2476
+        //            //{
2477
+        //            //    string[] strids = dtjb.Rows[0]["F_OtherDeptIds"].ToString().Split(',');
2478
+        //            //    string dns = string.Empty;
2479
+        //            //    foreach (string strid in strids)
2480
+        //            //    {
2481
+        //            //        var dinfo = new BLL.T_Sys_Department().GetModel(Int32.Parse(strid));
2482
+        //            //        if (dinfo != null)
2483
+        //            //        {
2484
+        //            //            if (string.IsNullOrEmpty(dns))
2485
+        //            //            {
2486
+        //            //                dns = dinfo.F_DeptName;//交办单位
2487
+        //            //            }
2488
+        //            //            else
2489
+        //            //            {
2490
+        //            //                dns += "," + dinfo.F_DeptName;//交办单位
2491
+        //            //            }
2492
+        //            //        }
2493
+        //            //    }
2494
+        //            //    dr["OtherDeptName"] = dns;
2495
+        //            //}
2496
+        //        }
2497
+        //        //获取最新通报信息
2498
+        //        string sqltb = "SELECT TOP 1 * FROM T_Bus_NoticeCriticism WHERE F_WorkOrderId='" + dr["F_WorkOrderId"].ToString() + "' and F_State=1 and F_IsDelete=0  ORDER BY F_Id DESC";
2499
+        //        var dttb = DbHelperSQL.Query(sqltb).Tables[0];
2500
+        //        if (dttb.Rows.Count > 0)
2501
+        //        {
2502
+        //            if (dttb.Rows[0]["F_DeptIds"] != null && dttb.Rows[0]["F_DeptIds"].ToString() != "")
2503
+        //            {
2504
+        //                dr["NoticeDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dttb.Rows[0]["F_DeptIds"].ToString() + "')");
2505
+        //            }
2506
+
2507
+        //            dr["NoticeReson"] = dttb.Rows[0]["F_Content"] != null? dttb.Rows[0]["F_Content"].ToString():"";
2508
+        //        }
2509
+        //        if (dr["F_LeaveRecordId"] != null && dr["F_LeaveRecordId"].ToString() != "")
2510
+        //        {
2511
+        //            dr["FilePath"] = GetLeavePath(dr["F_LeaveRecordId"].ToString(), config.F_ParamValue);
2512
+        //        }
2513
+        //        else if (dr["F_CallRecordId"] != null && dr["F_CallRecordId"].ToString() != "")
2514
+        //        {
2515
+        //            dr["FilePath"] = GetCallPath(dr["F_CallRecordId"].ToString(), config.F_ParamValue);
2516
+        //        }
2517
+        //        List<ButtonGroup.button> btns = new List<ButtonGroup.button>();
2518
+        //        btns.Add(ButtonGroup.query());
2519
+        //        dr["Buttons"] = btns;
2520
+
2521
+        //        dr["IsReturnNotice"] = IsReturnNotice;
2522
+        //    }
2523
+
2524
+        //    #endregion
2525
+
2526
+        //    var obj = new
2527
+        //    {
2528
+        //        state = "success",
2529
+        //        message = "成功",
2530
+        //        rows = dt,
2531
+        //        total = recordCount
2532
+        //    };
2533
+
2534
+        //    return Content(obj.ToJson());
2535
+        //}
2536
+
2053
         /// <summary>
2537
         /// <summary>
2054
         /// 获取通报工单列表
2538
         /// 获取通报工单列表
2055
         /// </summary>
2539
         /// </summary>
2063
 
2547
 
2064
             Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
2548
             Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
2065
 
2549
 
2066
-            string sql = " and F_IsDelete=0 and isnull(F_IsNotice,0) =1";
2550
+            string sql = " and F_IsDelete=0 ";
2067
             string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));
2551
             string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));
2068
             string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
2552
             string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
2069
             string strkey = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));
2553
             string strkey = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));
2144
                 sql += " and datediff(day,F_CreateTime,'" + strendtime + "')>=0   ";
2628
                 sql += " and datediff(day,F_CreateTime,'" + strendtime + "')>=0   ";
2145
             }
2629
             }
2146
 
2630
 
2631
+            if (userModel.F_RoleCode == "WLDW")
2632
+            {
2633
+                string sqlwhere = "select F_WorkOrderID from T_Bus_NoticeCriticism where ','+F_DeptIds+',' like  '%," + userModel.F_DeptId + ",%' and F_State=1 and F_IsDelete=0 ";
2634
+                sql += " and F_WorkOrderID in(" + sqlwhere + ")";
2635
+            }
2636
+
2147
             if (strpageindex.Trim() != "")
2637
             if (strpageindex.Trim() != "")
2148
             {
2638
             {
2149
                 pageindex = Convert.ToInt32(strpageindex);
2639
                 pageindex = Convert.ToInt32(strpageindex);
2205
                 var dtjb = DbHelperSQL.Query(sqljb).Tables[0];
2695
                 var dtjb = DbHelperSQL.Query(sqljb).Tables[0];
2206
                 if (dtjb.Rows.Count > 0)
2696
                 if (dtjb.Rows.Count > 0)
2207
                 {
2697
                 {
2208
-                    //if (dtjb.Rows[0]["F_MainDeptId"].ToString() == userModel.F_DeptId.ToString()) { iszbdw = "1"; }
2209
                     dr["DeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_MainDeptId"].ToString() + "')");
2698
                     dr["DeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_MainDeptId"].ToString() + "')");
2210
                     if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
2699
                     if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
2211
                     {
2700
                     {
2212
                         dr["OtherDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_OtherDeptIds"].ToString() + "')");
2701
                         dr["OtherDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dtjb.Rows[0]["F_OtherDeptIds"].ToString() + "')");
2213
                     }
2702
                     }
2214
-                    //int did = Int32.Parse(dtjb.Rows[0]["F_MainDeptId"].ToString());
2215
-                    //var deptinfo = new BLL.T_Sys_Department().GetModel(did);
2216
-                    //if (deptinfo != null)
2217
-                    //{
2218
-                    //    //if (did == userModel.F_DeptId) { iszbdw = "1"; }
2219
-                    //    dr["DeptName"] = deptinfo.F_DeptName;//交办单位
2220
-                    //}
2221
-
2222
-                    //if (dtjb.Rows[0]["F_OtherDeptIds"] != null && dtjb.Rows[0]["F_OtherDeptIds"].ToString() != "")
2223
-                    //{
2224
-                    //    string[] strids = dtjb.Rows[0]["F_OtherDeptIds"].ToString().Split(',');
2225
-                    //    string dns = string.Empty;
2226
-                    //    foreach (string strid in strids)
2227
-                    //    {
2228
-                    //        var dinfo = new BLL.T_Sys_Department().GetModel(Int32.Parse(strid));
2229
-                    //        if (dinfo != null)
2230
-                    //        {
2231
-                    //            if (string.IsNullOrEmpty(dns))
2232
-                    //            {
2233
-                    //                dns = dinfo.F_DeptName;//交办单位
2234
-                    //            }
2235
-                    //            else
2236
-                    //            {
2237
-                    //                dns += "," + dinfo.F_DeptName;//交办单位
2238
-                    //            }
2239
-                    //        }
2240
-                    //    }
2241
-                    //    dr["OtherDeptName"] = dns;
2242
-                    //}
2243
                 }
2703
                 }
2244
                 //获取最新通报信息
2704
                 //获取最新通报信息
2245
                 string sqltb = "SELECT TOP 1 * FROM T_Bus_NoticeCriticism WHERE F_WorkOrderId='" + dr["F_WorkOrderId"].ToString() + "' and F_State=1 and F_IsDelete=0  ORDER BY F_Id DESC";
2705
                 string sqltb = "SELECT TOP 1 * FROM T_Bus_NoticeCriticism WHERE F_WorkOrderId='" + dr["F_WorkOrderId"].ToString() + "' and F_State=1 and F_IsDelete=0  ORDER BY F_Id DESC";
2251
                         dr["NoticeDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dttb.Rows[0]["F_DeptIds"].ToString() + "')");
2711
                         dr["NoticeDeptName"] = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + dttb.Rows[0]["F_DeptIds"].ToString() + "')");
2252
                     }
2712
                     }
2253
 
2713
 
2254
-                    dr["NoticeReson"] = dttb.Rows[0]["F_Content"] != null? dttb.Rows[0]["F_Content"].ToString():"";
2714
+                    dr["NoticeReson"] = dttb.Rows[0]["F_Content"] != null ? dttb.Rows[0]["F_Content"].ToString() : "";
2255
                 }
2715
                 }
2256
                 if (dr["F_LeaveRecordId"] != null && dr["F_LeaveRecordId"].ToString() != "")
2716
                 if (dr["F_LeaveRecordId"] != null && dr["F_LeaveRecordId"].ToString() != "")
2257
                 {
2717
                 {